I'm attempting to write some C bindings for the Go language, and have run into a sort of sticky situation when setting up the Cgo compilation in Windows. I have code that looks like the following:
// #cgo windows CFLAGS: -I C:/dev/extlibs/include/ // #cgo windows LDFLAGS: -lMyLib -L C:/dev/extlibs/lib/ // #include <mylib/mylib.h> import "C"
which is allows me to avoid installing Dlls, libs, and header files directly into my C:\Windows directory, but doesn't allow for much flexibility when other developers are working with a different file system setup (they all need the libs to be in C:/dev/extlibs/...).
Is there a way I could referent an environment variable from within the code? Perhaps something along the lines of:
// #cgo windows CFLAGS: -I $EXTLIBS$/include/
Or is there another way that people solve this issue that I have missed? I've spent some time googling around on this subject and haven't seen much that has been useful, so any information and/or resources could be a real help!