• 10266阅读
  • 4回复

问个问题:*.so共享库文件在makefile中怎样导入 [复制链接]

上一主题 下一主题
离线noname100
 

只看楼主 倒序阅读 楼主  发表于: 2006-04-29
我在 -L后面加它在的路径,总是加不上
[ 此贴被XChinux在2006-05-07 23:49重新编辑 ]
离线shiroki

只看该作者 1楼 发表于: 2006-04-29
-l选项
如libaaa.so就-laaa
--
shiro is White
ki is tree
http://www.cuteqt.com
论坛 http://www.cuteqt.com/bbs
博客 http://www.cuteqt.com/blog
博客镜像: http://sites.cuteqt.com/cuteqt
Linux/Qt/嵌入式讨论群 http://qun.qq.com/air/5699823
离线noname100

只看该作者 2楼 发表于: 2006-04-29
先谢谢版主了

我改了后

linux:~/program/sqlite # make
arm-linux-g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -DNO_DEBUG -I/usr/local/arm-linux/qt_toolchain/qt-2.3.2/include -o main.o main.cpp
main.cpp: In function `int main(int, char**)':
main.cpp:8: warning: unused parameter `int argc'
main.cpp:8: warning: unused parameter `char**argv'
arm-linux-g++ -o test main.o   -L/usr/lib/sqlite3 -lm -lqte -lts
main.o(.text+0x10): In function `main':
: undefined reference to `sqlite3_open'
main.o(.text+0x24): In function `main':
: undefined reference to `sqlite3_close'
main.o(.text+0x38): In function `main':
: undefined reference to `sqlite3_errmsg'
main.o(.text+0x4c): In function `main':
: undefined reference to `sqlite3_close'
collect2: ld returned 1 exit status
make: *** [test] 错误 1
linux:~/program/sqlite #

是不是说sqlite3已经加载进去了,如果是,那错误可能的原因是啥啊
离线shiroki

只看该作者 3楼 发表于: 2006-05-09
-L/usr/lib/sqlite3 -lm -lqte -lts
没写 -lsqlite3阿, 没链上这个库
--
shiro is White
ki is tree
http://www.cuteqt.com
论坛 http://www.cuteqt.com/bbs
博客 http://www.cuteqt.com/blog
博客镜像: http://sites.cuteqt.com/cuteqt
Linux/Qt/嵌入式讨论群 http://qun.qq.com/air/5699823
离线bzf2002
只看该作者 4楼 发表于: 2006-05-19
搂主,我也遇到了相似的问题,我在makefile文件的LIB后面加上了我的动态库,但最后编译还是无法通过,提示说动态库里定义的函数没有定义,我想应该是动态库没有联接上,请问该怎么连接啊?
快速回复
限100 字节
 
上一个 下一个