bug-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Cannot include algorithm header together with C code in std=c++11 mode (


From: Robert Hairgrove
Subject: Cannot include algorithm header together with C code in std=c++11 mode (bug-id=56038)
Date: Tue, 9 Dec 2014 00:14:26 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.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...




reply via email to

[Prev in Thread] Current Thread [Next in Thread]