链接Eclipse中的静态库cdt [英] link static lib in eclipse cdt

查看:99
本文介绍了链接Eclipse中的静态库cdt的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对不起!我已经google了这么多,找不到答案!这是哑的我知道。



我不能链接到静态库(*。a)在eclipse cdt。我列出他们所有在Project->设置 - > GCC C + +链接器 - >库。我使用绝对路径,以确保我有正确的...和我得到:



找不到-l / usr / local / lib / libboost_date_time.a



我相信它是愚蠢的,我做错了:(



编辑 - 我应该提到我在运行时链接库...

解决方案

我记得有一个类似的问题,当我在linux下编译我们的代码(来自Windows背景),如果我记得正确指定静态库的绝对路径也不起作用。



你知道链接到libboost_date_time .a,你需要指定boost_date_time而不使用lib和.a?在我的情况下,解决了问题。/ usr / local / lib应该在你的路径上任何情况下AFAIR。 >

I am sorry! I have googled this a lot and cannot find an answer! It's dumb I know.

I cannot link in static libraries(*.a) in eclipse cdt. I listed them all in Project->Settings-> GCC C++ linker -> Libraries. I used the absolute path to make sure I had the lib correct... and i get:

cannot find -l/usr/local/lib/libboost_date_time.a

I am sure it's stupid whatever I am doing wrong :(

Edit -- and i should mention i am linking the libraries at run time...

解决方案

I remember having a similar issue way back when I was compiling our code under linux (coming from a windows background) and if I recall correctly specifying the absolute path to the static lib also didn't work.

Are you aware that to link to "libboost_date_time.a", you need to specify "boost_date_time" without the "lib" and the ".a"? In my case that solved the problem. /usr/local/lib should be on your path in any case AFAIR.

这篇关于链接Eclipse中的静态库cdt的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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