C ++:eclipse CDT中的外部库 [英] C++: External library in eclipse CDT

查看:162
本文介绍了C ++: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.

项目目录:


  1. include(.h files)

  2. source(.cpp。files ..)

  3. lib(libbozorth3.a,LSFMatcher.a)

我想将静态库链接到我的应用程序我按照以下步骤操作:

I want link that static libraries with my application I follow this steps:


  1. project-> properties-> general-> path和symbols-> include目录路径和库(bozorth3.a,LSFMatcher.a),并添加库路径。

  2. 也在链接器部分中添加相同的库

当我构建程序时,它显示一个错误
找到-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.

推荐答案

我通常配置



  1. 库搜索路径(需要编译)

  2. 运行时搜索路径(-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屋!

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