2012年7月3日

gcc -l参数和-L参数 [转]

摘要: -l参数就是用来指定程序要链接的库,-l参数紧接着就是库名,那么库名跟真正的库文件名有什么关系呢?就拿数学库来说,他的库名是m,他的库文件名是libm.so,很容易看出,把库文件名的头lib和尾.so去掉就是库名了。当我们自已要用到一个第三方提供的库名字libtest.so,那么我们只要把libtest.so拷贝到/usr/lib里,编译时加上-ltest参数,我们就能用上libtest.so库了(当然要用libtest.so库里的函数,我们还需要与libtest.so配套的头文件)。放在/lib和/usr/lib里的库直接用-l参数就能链接了,但如果库文件没放在这三个目录里,而是放在其他目录 阅读全文

posted @ 2012-07-03 02:33 龙豆 阅读(258) 评论(0) 推荐(0) 编辑

gcc: multiple definition of [转]

摘要: /home/tace/openav/source/SeamlessMessage/CPaoFlt.o: In function `CPaoFlt::get_m_strPrmair() const':CPaoFlt.cpp:(.text+0x0): multiple definition of `CPaoFlt::get_m_strPrmair() const'/home/tace/openav/source/SeamlessMessage/CPaoFlt.o:CPaoFlt.cpp:(.text+0x0): first defined heregcc在编译过程中报函数重复定义( 阅读全文

posted @ 2012-07-03 02:31 龙豆 阅读(21216) 评论(1) 推荐(1) 编辑

导航