c - -mini-xml 中未找到 lmxml 库?

标签 c gcc linker mini-xml

我已经在我的计算机上构建并安装了 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/

相关文章:

ios - 我是否正确创建此 C 数组并将其传递给 Objective-C 方法并使用属性引用它?

c - DMD:链接到 libc.a?或者 core.simd 信息?

c - 如何用 C 编译简单的 gearman worker?

c++ - 缺少 v 表。是什么原因?

c++ - 在 CMake 中链接 C 和 CXX 文件

C : convert to integer using bits

c - 如何正确处理套接字接受返回 "Too many open files"

c - 如何将文件名的输入作为函数的参数?

c - gcc -nostdlib 和 mudflap

c++ - C++ 中的 fstream 错误