标题:问个问题:*.so共享库文件在makefile中怎样导入
作者:noname100
日期:2006-04-29 04:09
内容:
我在 -L后面加它在的路径,总是加不上
#1 [shiroki 04-29 16:13]
-l选项
如libaaa.so就-laaa
#2 [noname100 04-29 19:18]
先谢谢版主了
我改了后
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: *** 错误 1
linux:~/program/sqlite #
是不是说sqlite3已经加载进去了,如果是,那错误可能的原因是啥啊
#3 [shiroki 05-09 15:37]
-L/usr/lib/sqlite3 -lm -lqte -lts
没写 -lsqlite3阿, 没链上这个库
#4 [bzf2002 05-19 17:26]
搂主,我也遇到了相似的问题,我在makefile文件的LIB后面加上了我的动态库,但最后编译还是无法通过,提示说动态库里定义的函数没有定义,我想应该是动态库没有联接上,请问该怎么连接啊?