0

I have a custom installation of g++ 4.8.1 in my home directory. However the include files in that installation have no extensions! (except for tgmath.h, fenv.h, complex.h, and cxxabi.h)

Thus even if I include the installation include directory (for me under include/c++/4.8.1) in C_INCLUDE_PATH, it still goes to the system-wide gcc include files.

Why do the include files in the gcc install not have extensions and will renaming them to have a .h extension fix the problem?

Edit: Background -- I'm trying to compile Qt on Centos 6.5. Compilation using the system-wide g++ (version 4.4.7) works but the using my self-compiled version of g++ (4.8.1) doesn't work. It gives me the error

In file included from /home/sj1/Software/qt/4.8.7/build/include/QtCore/../../../qt-everywhere-opensource-src-4.8.7/src/corelib/tools/qbytearray.h:48:0, from /home/sj1/Software/qt/4.8.7/build/include/QtCore/qbytearray.h:1, from /home/sj1/Software/qt/4.8.7/build/include/QtCore/../../../qt-everywhere-opensource-src-4.8.7/src/corelib/tools/qstring.h:46, from /home/sj1/Software/qt/4.8.7/build/include/QtCore/qstring.h:1, from /home/sj1/Software/qt/4.8.7/build/include/QtCore/../../../qt-everywhere-opensource-src-4.8.7/src/corelib/io/qiodevice.h:51, from /home/sj1/Software/qt/4.8.7/build/include/QtCore/qiodevice.h:1, from /home/sj1/Software/qt/4.8.7/build/include/QtCore/../../../qt-everywhere-opensource-src-4.8.7/src/corelib/io/qdatastream.h:46, from /home/sj1/Software/qt/4.8.7/build/include/QtCore/qdatastream.h:1, from /home/sj1/Software/qt/4.8.7/build/include/QtCore/../../../qt-everywhere-opensource-src-4.8.7/src/corelib/tools/qstringlist.h:46, from /home/sj1/Software/qt/4.8.7/build/include/QtCore/qstringlist.h:1, from project.h:45, from project.cpp:42: /usr/include/string.h:548:5: error: ‘__locale_t’ has not been declared __locale_t __loc)

  • 1
    What steps did you use to install, and what makes the install "custom"? Many of the C++ standard library headers don't have extensions any more, e.g. iostream. See stackoverflow.com/a/441683/2877364 – cxw Jun 24 '15 at 9:43
  • It was a standard install as far as I recall. The file in question is string.h -- when I try to compile Qt against my custom GCC installation, it goes to the string.h in /usr/include and I get an error (which I think may be because of this problem) – Opt Jun 24 '15 at 10:29
  • Can you clarify whether you are talking about C or C++ here? your title talks about gcc but the path you added is include/c++/4.8.1 – steeldriver Jun 24 '15 at 12:13
  • Hmm, I wanna say C but I only seem to have the c++ directory...is that problematic? gcc 4.8.1 is in the bin though. – Opt Jun 24 '15 at 13:06
  • Let's go back to the beginning! What OS? What distribution of gcc? E.g., direct from GNU, rpm, deb,... Are you trying to compile Qt on its own or as part of another package? What distribution of Qt or that other package? There are too many variables-we need some more detail to help effectively. Thanks! – cxw Jun 24 '15 at 23:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.