问题描述
我的构建要求我发出以下命令:
My build requires that I issue the following commands:
$ g++ sniff.cpp -o sniff -lcrafter
但是,在我的 Eclipse 构建中,编译器得到的只是:
However, in my Eclipse build, all the complier gets is:
g++ -o "sniffer_crafter" ./src/sniffer_crafter.o
收到这些命令后,它抱怨我有一个未定义的对库 Crafter 的引用.
After getting these commands it complains that I have an undefined reference to the library Crafter.
如何使用 Eclipse 解决此链接问题?我见过其他人对类似问题的回答,但他们似乎没有解决 Eclipse 的当前布局.我正在使用最新版本的 Eclipse Kepler.
How can I resolve this linking issue using Eclipse? I have seen others answers to similar questions, but they don't seem to address Eclipse's current layout. I'm using the most recent edition of Eclipse Kepler.
推荐答案
包含库:-
右键项目 -->
- 转到属性
- 然后转到 --> C/C++ Build --> 设置
在那里你会找到链接器和子类型库.
There you will find Linker and sub type Libraries.
在右侧的库搜索路径中添加库路径(您的 .so 文件所在的位置)并在库中提供库名称
Add the library path in Library Search Path on right hand side (where your .so file is located) and give the lib name in libraries
对于 libcrafter.so 路径 -->/opt/myLib/lib
for libcrafter.so path --> /opt/myLib/lib
将路径指定为/opt/myLib/lib和库名称作为工匠
give path as /opt/myLib/lib and library name as crafter
这篇关于Eclipse 中的编译器标志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)