Linux g++ compiling error: /usr/bin/ld: cannot find -l/usr/local/include

你。 提交于 2019-12-11 07:57:10

问题


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:

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:


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



来源:https://stackoverflow.com/questions/25498239/linux-g-compiling-error-usr-bin-ld-cannot-find-l-usr-local-include

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!