Linux g++ 编译错误:/usr/bin/ld: 找不到 -l/usr/local/include [英] Linux g++ compiling error: /usr/bin/ld: cannot find -l/usr/local/include

查看:275
本文介绍了Linux g++ 编译错误:/usr/bin/ld: 找不到 -l/usr/local/include的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从事一个涉及 protobufzmq 的项目.我已经在 VS2010 上完成了它,现在想让它在 Linux 下工作.我刚刚在我们的 Linux 服务器上安装了 protobufzmqMakefile 看起来像这样:

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

make 后,出现以下错误:

After make, I got the following error:

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

有人知道吗?

推荐答案

-l (minus ell) 是为库文件搜索解析引用,你要-I(减号)指定包含目录.

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

这篇关于Linux g++ 编译错误:/usr/bin/ld: 找不到 -l/usr/local/include的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆