c-for-go
c-for-go copied to clipboard
Does not search compiler-specific header directories (Linux)
Certain header files, such as stddef.h are compiler and/or version dependent and do not reside in /usr/include for compatibility reasons. c-for-go however does not look for these directories.
Running <gcc/clang> --print-file-name=include
will print this compiler-specific include folder. On my system these are /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/include
and /usr/lib/clang/8.0.0/include
for gcc and clang respectively (/usr/lib/gcc/x86_64-w64-mingw32/8.3.0/include
for mingw32).
This issue prevents github.com/vulkan-go/vulkan from being generated on Linux.
I believe this is what's happening on OSX as well in #49
Have you tried to use -ccincl
option?
Use built-in sys include paths from a hosted C-compiler.
- it will parse output of cpp -v
:
E.g. clang under macOS
#include <...> search starts here:
/usr/local/include
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.1/include
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks (framework directory)
End of search list.
Running cpp --print-file-name=include
reports only this:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.1/include
This does fix the issue, but now all uint64
s and long
s have been changed to uint
s and int
s in Go and C source files respectively (I'm using amd64). Is there a way to change the compiler? cpp
points to GCC, while these bindings have presumably been generated using Clang
Bindings are always generated by c-for-go, however it could load some extra includes.
all uint64s and longs have been changed to uints and ints in Go and C source files respectively
C sources are never altered by c-for-go. Anyway, can you just paste some examples?
Also, this file has the same definitions but claims a different path. Don't know if it's related.
C sources are never altered by c-for-go. Anyway, can you just paste some examples?
Sorry, I meant generated source files (destination files? 🤔).