我正在尝试编译一个GO应用程序,它使用戈基里库。我安装了对接器,并在本地编译了xgo交叉编译器。当尝试执行以下命令时:
./xgo mydomain.com/test/test-app我得到以下错误:
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我安装了xcode-tools,它帮助我为我的机器编译它( machine )。但是,我无法将其编译到其他环境中。
任何帮助都将不胜感激。谢谢。
更新1:
我试图添加依赖项,但是得到了相同的结果:
./xgo --deps /usr/local/Cellar/libiconv/1.14/ mydomain.com/test/test-app在xgo的日志中甚至提到这个库已经被缓存了:
Dependency already cached: /Users/macuser/.xgo-cache/1.14.发布于 2018-04-06 13:18:50
从文件中:
假设依赖的C/C++库是基于配置/制作的,为交叉编译做了适当的准备,并可作为tarball下载(.tar、.tar.gz或.tar.bz2)。进一步的计划包括将其扩展到基于cmake的项目,如果需要的话(如果对您很重要的话,请打开一个问题)。 此类依赖项可以通过--deps参数添加。它们将在开始交叉编译和缓存包之前被检索,以节省后续调用的带宽。
所以在这个例子中,应该是:
./xgo --deps https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.15.tar.gz mydomain.com/test/test-app
https://stackoverflow.com/questions/38208270
复制相似问题