Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在我的 makefile 中指定我想与libtiff库链接。仅在 LDFLAGS 中指定 -ltiff 是行不通的。
libtiff
您可以使用 -L 标志(请参阅编译器手册 - 我假设您使用的是 gcc 或 g++
或者
设置环境变量LD_LIBRARY_PATH以包含库的路径
LD_LIBRARY_PATH
但是您还应该考虑静态或动态链接。两个编译器的文档都很好地解释了如何做。
尝试给出以下编译选项。
g++ -L[你机器上的 libtiff 路径] -ltiff [你剩下的选项] ...
-L 选项用于告诉 gcc,在哪里可以找到您尝试链接的库。