C ++:eclipse CDT中的外部库 [英] C++: External library in eclipse CDT
问题描述
现在我正在使用eclipse CDT作为我的C / C ++应用程序,但当我链接我的外部库时出现问题,它在运行时无法正常加载,即使我把库文件放在源文件附近,我给出了图书馆的路径,它的名称正确。
Now I am using eclipse CDT for my C/C++ Application, but there is problem when I link my external library, it could not be loaded properly at run time, even through I put the library file near the source file, I gave the library path, and it's name correctly.
项目目录:
- 包含(.h文件)
- 源(.cpp。files ..)
- lib(libbozorth3.a,LSFMatcher.a)
我想链接静态库与我的应用程序我按照以下步骤:
I want link that static libraries with my application I follow this steps:
- project-> properties-> general-> path and symbols-> include directory path,and libraries(bozorth3.a,LSFMatcher.a),并添加库路径。
<我也添加相同的库在链接器部分也
当我构建程序时,它显示一个错误
不能找到-lbozorth3.a
找不到-lLSFMatcher.a
When I build the program it displays a error cannot find -lbozorth3.a cannot find -lLSFMatcher.a
所以我需要正确的步骤将外部库添加到c / c ++应用程序。
So I need the correct steps to add the external library to c/c++ application.
推荐答案
我通常配置
- 图书馆
- 库搜索路径(需要编译)
- 运行时搜索路径(-rpath链接器选项)
(请参见下面的图片,并将链接器标记中的路径与您在库搜索路径中使用的路径进行交换)
(see images below and exchange the path in the Linker flags to that one you used in the library search path)
这篇关于C ++:eclipse CDT中的外部库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!