标题:自己写了个库文件libtest.a,怎么总也连不上?
作者:slowly13008
日期:2006-12-12 14:57
内容:
工程文件夹d:\test
里面有hello.c,test1.h,libtest1.a
test1.h是库所需头文件,hello.c是调用库的程序,在自动生成makefile 后,修改为
LIBS = -L"D:\Qt\4.0.1\lib" -lmingw32 -lqtmaind -lQtCored4 -lQtGuid4
-L"D:/test/libtest1.a"
或是在命令行下输入-L"D:\test\libtest1.a"这个选项都不能连接到库上,怎么回事?
是windows下的qt4.01
#1 [rangzh 12-12 23:23]
LIBS = -L"D:/test/" -ltest1
#2 [slowly13008 12-13 08:59]
谢谢,顺便问一下,可以在windows版的qt中用.lib的库吗?
#3 [XChinux 12-13 18:37]
可以
#4 [woshihaoren 12-13 19:02]
可是如何写自己的库文件呢,我是新手?
#5 [lsosa 12-14 09:40]
编写库文件和你平时的文件没有什么两样,比如你写了个hello.c文件,用下面命令
#gcc -c hello.c
生成.o文件;
#ls
hello.c hello.o
#ar -sr libhello.a hello.o
就可以生成后缀名为.a的库了;
note:the platform is linux, :)