New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stdlib.h: No such file or directory #22
Comments
Ok, so this issue occurs after upgrading GCC to 6.3.0. However, it only seems to occur under certain conditions. At least here I haven't had any trouble using GCC 6.x (at the time it was the current release). https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70936 might be the relevant GCC issue. Note that I can only take the effort to test with latest GCC (currently 7.1.1) and Clang (4.0.1) and not various configurations. Patches to support different versions/configurations are welcome of course. I'm wondering why I'm not affected by this issue. Even cross-compilation works for me (some comments in the GCC issue state they have the bug in their cross tool-chain). However, it could also be a CMake bug or something wrong with my build scripts (eg. incorrect use of Since I can not reproduce myself, I can only give hints and suspicions. That's what I would try to find a workaround:
Of course I can help with that (especially the last point). |
And, did you do any of the mentioned steps? I have just checked build scripts of tageditor and its dependencies and I see nowhere use of |
same error if executed manually
If I change this:
to this:
it fixes it - not sure what to change at a higher level to make that happen |
So the search order for includes should be the same, regardless whether
So the only difference between those options is (as far as I see it) the "special treatment that is applied to the standard system directories". Regardless why it makes a difference, you should be able to convince CMake to omit
The first ones cause CMake to omit |
hm - so you are saying |
Yes, in this particular case and only concerning the order in which the search paths are being used. Not exactly sure which difference this "special treatment that is applied to the standard system directories" makes. Apparently more than what's in the documentation. Is the I suppose that specifying a directory which is already default again explicitly via
So if specifying a default include dir again with However, if you then still need |
Your suggestion for:
Makes sense - we shouldnt be letting Cmake include that explicitly if we dont
Running the last command with GCC 6.3.0 causes the problem. So for now I think I |
Sorry to post off topic but I'm experiencing the similar issue at Linux from Scratch. When I do a cmd 'make tooldir/=usr' for Binutilus (chapter 6.16 for version 8.1) it gives me the error: In file included from ../../gold/gold.h:30:0, I posted this on linuxquestions.org but the answer I received is to start all over again which unlikely. |
I can summarize for you what this issue was about:
If your issue has the same source, you could apply the same workaround. For further investigation, you could also try to follow the steps in my first comment on this issue being aware that the gold linker is likely not using the CMake build system and verbose output is hence likely enabled in a slightly different way. I assume the project you want to build is the gold linker of the GNU binutils? |
@Martchus thank you for replying. I was trying to do with -isystem(-I) but that could not work at my side. While did some research on internet the problem showed at /usr/include/c++/7/cstdlib and /usr/include/c++/7/bits/std_abs.h. Only thing was to remove the '_next' from #include_next <stdlib.h> and #include_next <math.h>(located on second file). |
I got the same problem when I have two version of gcc/g++ installed. Old version is in /usr/include and new version is in =/usr/local/include/c++/8.2.0.
change the order of CPLUS_INCLUDE_PATH will solve the problem.
put this in your ~/.bashrc |
@changshen Thanks for sharing your findings. Keep in mind that you've just hardcoded the GCC version into your Reminds me of something hacky I had to do for cross compiling with mingw-w64 while using native clang tooling. To make it at least a little bit robust, I avoided hardcoding the GCC version: https://github.com/Martchus/PKGBUILDs/blob/master/tageditor/mingw-w64-static/PKGBUILD#L40 |
This is currently a TagParser issue, but I bet it bubbles up to TagEditor - I posted this here thinking it was GCC issue, but it seems some *.cmake files here might need to be reworked:
http://cygwin.com/ml/cygwin/2017-08/msg00192.html
Here is possible fix:
http://github.com/opencv/opencv/pull/7390/files
The text was updated successfully, but these errors were encountered: