Skip to content
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

Zapcc not able to compile due to not finding stddef.h while Clang compiles fine. #39

Open
SeanRamey opened this issue Nov 3, 2019 · 5 comments
Labels
bug Something isn't working

Comments

@SeanRamey
Copy link

I am getting an error that zapcc can't find stddef.h? I have no clue as to what could be happening. Clang compiles perfectly.

1 error generated. generating dependencies for src/main.cpp In file included from src/main.cpp:1: In file included from src/sfmlpch.hpp:4: In file included from /usr/include/SFML/System.hpp:34: In file included from /usr/include/SFML/System/Err.hpp:32: In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../include/c++/9.2.0/ostream:38: In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../include/c++/9.2.0/ios:38: In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../include/c++/9.2.0/iosfwd:40: In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../include/c++/9.2.0/bits/postypes.h:40: In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../include/c++/9.2.0/cwchar:44: /usr/include/wchar.h:35:10: fatal error: 'stddef.h' file not found #include <stddef.h> ^~~~~~~~~~

1 error generated. generating dependencies for src/game.cpp In file included from src/game.cpp:1: In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../include/c++/9.2.0/iostream:39: In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../include/c++/9.2.0/ostream:38: In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../include/c++/9.2.0/ios:38: In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../include/c++/9.2.0/iosfwd:40: In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../include/c++/9.2.0/bits/postypes.h:40: In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../include/c++/9.2.0/cwchar:44: /usr/include/wchar.h:35:10: fatal error: 'stddef.h' file not found #include <stddef.h> ^~~~~~~~~~

1 error generated. generating dependencies for src/resources.cpp In file included from src/resources.cpp:1: In file included from src/stdpch.hpp:4: In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../include/c++/9.2.0/iostream:39: In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../include/c++/9.2.0/ostream:38: In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../include/c++/9.2.0/ios:38: In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../include/c++/9.2.0/iosfwd:40: In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../include/c++/9.2.0/bits/postypes.h:40: In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../include/c++/9.2.0/cwchar:44: /usr/include/wchar.h:35:10: fatal error: 'stddef.h' file not found #include <stddef.h>

@yrnkrn
Copy link
Owner

yrnkrn commented Nov 3, 2019

zapcc had not been updated for quite a while, maybe the include paths are not correct for gcc 9.2.

@yrnkrn yrnkrn added the bug Something isn't working label Dec 20, 2019
@hamoid
Copy link

hamoid commented Jan 22, 2020

@yrnkrn Will that change in the future? Is it easy to update those include paths?

@yrnkrn
Copy link
Owner

yrnkrn commented Jan 22, 2020

Yes, cherry picking just the relevant source lines for these include paths should be easy.

@dimitre
Copy link
Contributor

dimitre commented Feb 10, 2020

I'm having issues here too, zapcc doesnt find the file I need which is

xcrun clang -c -M -xc - <<<'# include <TargetConditionals.h>'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/TargetConditionals.h

any tips of how to make this work without recompile zapcc ? something like symlinks or maybe make additional folders?

and here the different paths for clang & zapcc

echo | clang++ -E -Wp,-v -
clang -cc1 version 11.0.0 (clang-1100.0.33.17) default target x86_64-apple-darwin18.7.0
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/local/include"
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.0/include
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks (framework directory)
End of search list.
# 1 "<stdin>"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 362 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "<stdin>" 2
echo | zapcc++ -E -Wp,-v -
clang -cc1 version 7.0.0 based upon LLVM 7.0.0svn default target x86_64-apple-darwin18.7.0
ignoring nonexistent directory "/usr/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /Volumes/tool/_src/llvm/build/lib/clang/7.0.0/include
 /System/Library/Frameworks (framework directory)
 /Library/Frameworks (framework directory)
End of search list.
# 1 "<stdin>"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 361 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "<stdin>" 2

@yrnkrn
Copy link
Owner

yrnkrn commented Feb 10, 2020

Maybe add the missing includes using -I flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants