Go - Cross compiling with CGO using xgo library
<p>I'm trying to compile a GO application, which uses the <a href="https://github.com/moovweb/gokogiri" rel="nofollow">gokiri</a> library.
I installed docker and compiled locally the <a href="https://github.com/karalabe/xgo" rel="nofollow">xgo</a> cross compiler for go.
When trying to execute the following command:</p>

<pre><code>./xgo mydomain.com/test/test-app
</code></pre>

<p>I get the following error:</p>

<pre><code>In file included from /usr/include/libxml2/libxml/parser.h:810:0,
             from /usr/include/libxml2/libxml/globals.h:18,
             from /usr/include/libxml2/libxml/threads.h:35,
             from /usr/include/libxml2/libxml/xmlmemory.h:218,
             from /usr/include/libxml2/libxml/tree.h:1307,
             from ../../github.com/moovweb/gokogiri/help/help.go:6:
/usr/include/libxml2/libxml/encoding.h:28:19: fatal error: iconv.h: No such file or directory
</code></pre>

<p>I've installed <code>xcode-tools</code> which helped me compile it for my machine (mac ox El Capitan). BUT, I cannot get it compiled to other environment.</p>

<p>Any help will be appreciated. Thanks.</p>

<p><strong>Update 1:</strong></p>

<p>I've tried to add the dependency, but got the same result:</p>

<pre><code>./xgo --deps /usr/local/Cellar/libiconv/1.14/ mydomain.com/test/test-app
</code></pre>

<p>It was even mentioned in the logs of the <code>xgo</code> that this library was already cached:</p>

<pre><code>Dependency already cached: /Users/macuser/.xgo-cache/1.14.
</code></pre>