Skip to content
Advertisement

Compilation with glibc 2.7 include path fails

I have compiled on my SLES 12.3 g++ 7.3 into the /FaF directory and glibc 2.27 is installed into the /FaF/glibc directory.

Compiling this very simple program with g++ -c testAbs.cpp -I /FaF/glibc/include fails horribly:

JavaScript

See the long error list. Below I inserted the first 15 lines – in total there are more than 300 lines of error messages.

Compiling it with g++ -c testAbs.cpp works fine. In this case it is using the system glibc 2.22 include files.

I found out that it must somehow relate to the g++ 7.3 installation. Using the system g++ 4.8.5 works fine compiled like this /usr/bin/g++-4.8 -c testAbs.cpp -I /FaF/glibc/include

What is going so horrible wrong compiling it with g++ 7.3 using the path to the glibc 2.27 include directories?

What am I messing up?

JavaScript

Advertisement

Answer

The example in the question was a minimized version of my include file. These are all include files which are needed in the project:

JavaScript

First, it could not be compiled in this order and I could not use the cmath include – due to the described error in the question.

I could fix it using these g++ switches:

JavaScript

g++ -xc++ -E -v - helped me to figure out which include paths are needed.

THE ORDER DOES MATTER

-I /usr/include must be last in the list!

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement