我已经在我的计算机上构建并安装了 mini-xml,但是当我尝试使用 gcc testmxml.c -lmxml -o myprogram
编译他们的测试程序时,出现错误 ld : 找不到 -lmxml 的库
这个问题有解决办法吗?
最佳答案
使用编译器选项-L<directory-with-lib-file>
指向构建 <directory-with-lib-file>
的目录 ( libmxml.so
) , libmxml.a
文件。
将此选项放在 gcc 命令行上的 -lmxml
之前选项。
示例:
-L/the/path/to/the/library/ -lmxml
有关如何引导 gcc 链接器的更多详细信息,请参阅此处:https://gcc.gnu.org/onlinedocs/gcc/Link-Options.html
关于c - -mini-xml 中未找到 lmxml 库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30285597/