[英]c++ LDLIBSOPTIONS makefile
I want to use some other project libraries in my implementation. 我想在实现中使用其他项目库。 The project has a /common folder where the libraries are located I want to include. 该项目有一个/ common文件夹,我想在其中包含库。 In my makefile under LDLIBSOPTIONS, I included the path where /common folder is located like: 在我的LDLIBSOPTIONS下的makefile中,我包括了/ common文件夹所在的路径,例如:
LDLIBSOPTIONS=-lpci -lpthread -I../../../OtherProj/Libs/common/
Then I include one .h file like: 然后,我添加一个.h文件,例如:
#include <ExampleLib.h>
However I still get 但是我仍然得到
fatal error: XXX.h: No such file or directory
What am I doing wrong? 我究竟做错了什么? Thanks. 谢谢。
LDLIBSOPTIONS
(more conventionally LDFLAGS
) is used for specifying options to the linker. LDLIBSOPTIONS
(更通常为LDFLAGS
)用于指定链接器的选项。 You need to specify the directory, using the -I
flag, in CXXFLAGS
: 您需要在CXXFLAGS
使用-I
标志指定目录:
CXXFLAGS += -I../../../OtherProj/Libs/common/
However given you are using non-standard names for your Makefile variables, CXXFLAGS
might be called something like CXXOPTIONS
, but the exact name is unknown to me. 但是,鉴于您为Makefile变量使用了非标准名称,因此CXXFLAGS
可能被称为CXXOPTIONS
之类的名称,但是确切的名称对我来说还是未知的。
Once this is solved you're going to be getting linker errors until you start specifying the library path using -L
; 解决此问题后,将开始出现链接器错误,直到您开始使用-L
指定库路径为止。 perhaps: 也许:
LDLIBSOPTIONS = -L../../../OtherProj/Libs/common/ -lpci -lpthread
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.