Reputation: 131606
I'm using Cygwin32 on Win7 64. I have g++ and libstdc++ installed. The C++ includes are located at /usr/lib/gcc/i686-pc-cygwin/4.8.2/include/c++/tr1/
- but nowhere under /usr/include
.
Is it reasonable to place them, by symlink, under /usr/include
? If not, why? And if so, why isn't this done by default And what should the symlink be? /usr/include/c++/
? Something else?
Note: Yes, I know I can add them to the compiler flags; I'm asking whether it's reasonable to do more than that.
Upvotes: 1
Views: 2423
Reputation: 12700
There shouldn't be any need, if you are talking about standard C++ includes. The g++ version destined to use them should know about that location, and since you might have different gcc versions around (for example, MinGW's one), it is better to leave it as it is just to not confuse other compilers.
If your compiler is having troubles finding its own includes, well, that's entirely another matter.
If you are curious about how and why this location is determined, read here, specifically under the option --enable-version-specific-runtime-libs ... it says something about "using several gcc versions in parallel". You can also check the actual configure script under libstdc++-v3 source code directory...
In my personal experience, when you are creating a single library for a bunch of platforms, you simply want (cross-) compilers as independent as possible. If every compiler puts its includes in /usr/include/c++ ... well, that can end bad. In fact, under that particular scenario, it could be reasonable for each compiler to hide its specific header and library files as well as possible...
Upvotes: 1
Reputation: 27577
Just add them to your environment variable CPPFLAGS
(or in your makefile
):
CPPFLAGS='-I/usr/lib/gcc/i686-pc-cygwin/4.8.2/include/c++/tr1 -I/whatev'
Upvotes: 0