linker input file unused because linking not done我的语句是 g++ -c a.cpp -lsqlite3
到网上查了一下,问题出在链接数据库的语句不应出现在编译语句里面。 上面的语句里面有 -c 即编译 compile,所以命令会忽略掉所有的 -l 链接库的命令。
而要链接数据库,应该在生成可执行文件时才使用。
正确的使用链接的语句应该是 g++ a.o -L. -lsqlite3 -o exename
My development notes
linker input file unused because linking not done我的语句是 g++ -c a.cpp -lsqlite3
1 条评论:
My partner and I absolutely love your blog and find a lot of your post's to be precisely what I'm
looking for. Do you offer guest writers to write content
for you personally? I wouldn't mind creating a post or elaborating
on many of the subjects you write about here. Again, awesome blog!
Feel free to surf to my weblog: wellmate wm-6
发表评论