Fatal error: 'stddef.h' file not found.
Trying to use ClangSharpPInvokeGenerator @GenerateClang.rsp to generate sources using Ubuntu 20.04 x64 and libClangSharp.so libclang.so libLLVM.so from NuGet packages for Ubuntu 20.04, I get next errors:
Diagnostics for 'src/include/api/idetector.hpp': /../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/cxxabi_init_exception.h:38:10: fatal error: 'stddef.h' file not found Skipping 'src/include/api/idetector.hpp' due to one or more errors listed above.
If I trying build libClangSharp.so myself, library building successfully. But, after using it, I get next errors:
Error: System.InvalidCastException: Unable to cast object of type 'ClangSharp.Decl' to type 'ClangSharp.TranslationUnitDecl'
Trying to use ClangSharpPInvokeGenerator @GenerateClang.rsp to generate sources using Ubuntu 20.04 x64 and libClangSharp.so libclang.so libLLVM.so from NuGet packages for Ubuntu 20.04, I get next errors: Diagnostics for 'src/include/api/idetector.hpp': /../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/cxxabi_init_exception.h:38:10: fatal error: 'stddef.h' file not found Skipping 'src/include/api/idetector.hpp' due to one or more errors listed above.
This sounds like one of the standard include directories isn't being passed into Clang.
If I trying build libClangSharp.so myself, library building successfully. But, after using it, I get next errors: Error: System.InvalidCastException: Unable to cast object of type 'ClangSharp.Decl' to type 'ClangSharp.TranslationUnitDecl'
This sounds like a mismatch between the libClang version and the expected version in libClangSharp. Clang makes breaking ABI changes almost every release and so you must ensure they match up exactly.
fatal error: 'stddef.h' file not found Skipping 'src/include/api/idetector.hpp' due to one or more errors listed above.
FYI for anyone who hits these kind of errors on macOS, quick fix for standard headers is:
- get SDK path
xcrun --show-sdk-path
- from output above, add
-I <SDK path>/usr/includeto theClangSharpPInvokeGeneratorinvocation or response file.
(at least on macOS 10.14 / XCode 11)