Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You could <em>try</em> using environment variables, the <a href="http://wiki.gentoo.org/wiki/Safe_Cflags" rel="nofollow noreferrer">Gentoo Linux Wiki page on Safe C Flags</a> has an example in the following format</p> <pre><code>CXXFLAGS="${CFLAGS}" </code></pre> <p>So you may be able to do something like</p> <pre><code>// #cgo windows CFLAGS: -I "${EXTLIBS}"/include/ </code></pre> <p>but my syntax may be off, and that may be Makefile specific.</p> <p>You could also try setting a <a href="http://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html" rel="nofollow noreferrer"><code>CPATH</code> environment variable</a> which:</p> <blockquote> <p>specifies a list of directories to be searched as if specified with -I, but after any paths given with -I options on the command line. This environment variable is used regardless of which language is being preprocessed.</p> </blockquote> <p>The equivalent for <code>-L</code> is, I think, <code>LIBRARY_PATH</code> (Described at the <code>CPATH</code> link).</p> <p>According to <a href="http://golang.org/cmd/cgo/" rel="nofollow noreferrer">http://golang.org/cmd/cgo/</a> one <em>sort of</em> recommended way to get around this in a platform independant way is to use <a href="http://www.freedesktop.org/wiki/Software/pkg-config/" rel="nofollow noreferrer">pkg-config</a>.</p> <pre><code>// #cgo pkg-config: mylib otherlib </code></pre> <p>It's available for windows (<a href="http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/" rel="nofollow noreferrer">http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/</a>) and there's some more information on installing it at <a href="https://stackoverflow.com/questions/1710922/how-to-install-pkg-config-in-windows">this question (How to install pkg config in windows?)</a></p> <p>Other than that, put all the dependencies into a sub-directory of the go-code, use relative paths in your <code>CFLAGS</code> and <code>LDFLAGS</code>, and share the entire bundle with other developers.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload