英文:
How can I see the internal compile commands which fail in a "go get" installation?
问题
我正在拉取和安装一个带有依赖项的软件包,但编译失败了,报错找不到文件magic.h
。我想知道编译命令和标志是什么,该怎么查看?使用-v
选项没有帮助。(我不需要关于如何获取magic.h
文件的建议,这只是一个例子。)
你可以查看编译过程中的详细信息,包括查找包含文件的位置和编译的确切源文件。在这种情况下,你可以在$GO_PATH/src
目录下找到源文件,检查其中的#include
是否被注释掉,同时确保/usr/local/include/match.h
文件存在。
英文:
I am pulling and installing a package with dependencies, and a compilation fails, in this case not finding a file, magic.h
. How do I see what the compilation commands and flags were? The -v
option does not help. (I do NOT want ideas about where to get magic.h from, this is just an example.)
<!-- language: lang-bash -->
$ go get -u github.com/presbrey/magicmime
# github.com/presbrey/magicmime
../../../src/github.com/presbrey/magicmime/magicmime.go:20:11: fatal error: 'magic.h' file not found
#include <magic.h>
How can I find, for example, where it was looking for include files, what source exactly it was compiling? (In this case the source file I see in $GO_PATH/src
has that #include
commented out, and a /usr/local/include/match.h
exists anyway.)
答案1
得分: 100
运行以下命令在问题包上进行编译:
go build -x github.com/presbrey/magicmime
英文:
Run go build -x on problem package:
go build -x github.com/presbrey/magicmime
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论