我的构建要求我发出以下命令:
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.
包含库:-
右键项目 -->
在那里你会找到链接器和子类型库.
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模板网!
如何在 android eclipse 中制作水平滑动日历?How can I make a horizontal sliding calendar in android eclipse?(如何在 android eclipse 中制作水平滑动日历?)
Eclipse CDT 没有在头文件更改时构建项目Eclipse CDT not building project on header file change(Eclipse CDT 没有在头文件更改时构建项目)
Eclipse C++ 包括来自我的源文件夹的头文件Eclipse C++ including header file from my source folder(Eclipse C++ 包括来自我的源文件夹的头文件)
Eclipse C/C++ (CDT) 将文件导入项目 - 找不到头文件Eclipse C/C++ (CDT) import files into project - header file not found - include path(Eclipse C/C++ (CDT) 将文件导入项目 - 找不到头文件 - 包
如何在 Eclipse 中生成 JNI 头文件How to generate JNI header file in Eclipse(如何在 Eclipse 中生成 JNI 头文件)
java.library.path 中没有 ocijdbc9no ocijdbc9 in java.library.path(java.library.path 中没有 ocijdbc9)