Linux g++编译错误:/usr/bin/ld:无法找到-l/usr/local/include。

时间:2021-12-26 15:07:06

I am working on a project in which protobuf and zmq are involved. I have finished it on VS2010 and now want to make it work under Linux. I just installed protobuf and zmq on our Linux server and the Makefile looks like this:

我正在研究一个项目,其中包含了protobuf和zmq。我已经在VS2010上完成了它,现在想让它在Linux下运行。我在Linux服务器上安装了protobuf和zmq, Makefile是这样的:

g++ -c  -D_DEBUG TestTDFAPI_v2.cpp -I ../
g++ -c  -D_DEBUG Platform.cpp
g++ -c  -D_DEBUG PathHelper.cpp                                                                                                    
g++ -c  -D_DEBUG MyStruct.pb.cpp            
g++ -c  -D_DEBUG MyStruct.cpp
g++ -o Test_TDFAPI_v2 Platform.o PathHelper.o MyStruct.pb.o MyStruct.o TestTDFAPI_v2.o -l /usr/local/include -L /usr/local/lib -L../ -L../linux/ -lTDFAPI_v2 -lWHNetWork -lpthread -lprotobuf

After make, I got the following error:

在做了之后,我得到了以下错误:

/usr/bin/ld: cannot find -l/usr/local/include
collect2: ld returned 1 exit status

Anyone has any clue?

谁有什么线索吗?

1 个解决方案

#1


4  

-l (minus ell) is for library files to search for resolving references, you want -I (minus eye) to specify include directories.

-l (- ell)是用于库文件搜索解析引用,您希望-I (- eye)指定包含目录。

#1


4  

-l (minus ell) is for library files to search for resolving references, you want -I (minus eye) to specify include directories.

-l (- ell)是用于库文件搜索解析引用,您希望-I (- eye)指定包含目录。