Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Cannot include algorithm header together with C code in std=c++11 mode (bug-id=56038)

1 view
Skip to first unread message

Robert Hairgrove

unread,
Dec 8, 2014, 7:35:24 PM12/8/14
to bug-gp...@gnu.org
Using g++ 4.9.0 on Ubuntu 12.04 LTS.

This is an old bug which apparently hasn't been fixed in g++ 4.9.0 yet:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56038

Please try this:
//--------------------------------
// save as file: algo_test.cpp
#include <algorithm>
#include <argp.h>

int main () {
return 0;
}
//--------------------------------

g++ -Wall -c -std=c++11 algo_test.cpp (compiles OK)

Now switch the order of the headers and try compiling again...(oops!)

Anyone know a temporary workaround? Apparently this has something to do with
some symbols in various intrinsics.h files not being wrapped in extern "C"
{...}. But I'm not going to start editing my system headers...


0 new messages