链接问题 [英] linking question
本文介绍了链接问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试创建一个库,但我收到了链接错误。
我有一个库mylib.so。 mylib.so使用mysqlclient。当我编译
我的.o文件,然后尝试使用mylib.so链接它们时,我收到一个错误
说mysql_init(mysqlclient的一部分)是未知的。
对我所缺少的任何帮助?
Mike
I am trying to create a library and I am getting a linking error.
I have a library mylib.so. mylib.so uses mysqlclient. When I compile
my .o files and then try to link them using mylib.so, i get an error
saying that mysql_init (part of mysqlclient) is unknown.
Any help on what I am missing?
Mike
推荐答案
md****@yahoo.com 写道:
我是试图创建一个库,我收到链接错误。
我有一个库mylib.so。 mylib.so使用mysqlclient。当我编译
我的.o文件然后尝试使用mylib.so链接它们时,我收到一个错误
说mysql_init(mysqlclient的一部分)是未知的。
任何帮助我缺少什么?
I am trying to create a library and I am getting a linking error.
I have a library mylib.so. mylib.so uses mysqlclient. When I compile
my .o files and then try to link them using mylib.so, i get an error
saying that mysql_init (part of mysqlclient) is unknown.
Any help on what I am missing?
OT在这里,尝试comp.unix.programmer。
提示 - 你必须指定所有目标文件和图书馆到链接器。
-
Ian Collins。
OT here, try comp.unix.programmer.
Hint - you have to specify all object files and libraries to the linker.
--
Ian Collins.
嘿迈克.. .i也许可以提供帮助....
i一次面临同样的问题...一个错误太微不足道了但是还没看过
。
在你的文件编译时出现提示你需要一些库你需要包含的
,你可能不会这样做,即
hey mike...i maybe able to help....
i faced the same problem at one time...an error too trivial but yet
over looked...
on the prompt when you compile your file there a re a few libs you need
to include, which you may not be doing, i.e
> gcc ... -lmysqlclient
或
>gcc... -lmysqlclient
or
这篇关于链接问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文