静态链接 log4c-1.2.1 与 Fedora 12 和 Eclipse 3.5.1
我们正在构建一个需要以静态模式链接 log4c 的项目,以下是正在生成的链接器错误的一部分。
/usr/local/lib/liblog4c.a(domnode-expat.o): In function `sd_domnode_read':
/log4c-1.2.1/src/sd/domnode-expat.c:316: undefined reference to `XML_ParserCreate'
/log4c-1.2.1/src/sd/domnode-expat.c:324: undefined reference to `XML_SetCommentHandler'
/log4c-1.2.1/src/sd/domnode-expat.c:325: undefined reference to `XML_SetUserData'
/log4c-1.2.1/src/sd/domnode-expat.c:327: undefined reference to `XML_Parse'
/log4c-1.2.1/src/sd/domnode-expat.c:355: undefined reference to `XML_ParserFree'
/log4c-1.2.1/src/sd/domnode-expat.c:328: undefined reference to `XML_GetErrorCode'
/log4c-1.2.1/src/sd/domnode-expat.c:328: undefined reference to `XML_ErrorString'
/usr/local/lib/liblog4c.a(domnode-expat.o): In function `sd_domnode_fread':
/log4c-1.2.1/src/sd/domnode-expat.c:242: undefined reference to `XML_ParserCreate'
/log4c-1.2.1/src/sd/domnode-expat.c:250: undefined reference to `XML_SetCommentHandler'
/log4c-1.2.1/src/sd/domnode-expat.c:251: undefined reference to `XML_SetUserData'
/log4c-1.2.1/src/sd/domnode-expat.c:258: undefined reference to `XML_GetBuffer'
/log4c-1.2.1/src/sd/domnode-expat.c:268: undefined reference to `XML_ParseBuffer'
/log4c-1.2.1/src/sd/domnode-expat.c:301: undefined reference to `XML_ParserFree'
/log4c-1.2.1/src/sd/domnode-expat.c:269: undefined reference to `XML_GetErrorCode'
/log4c-1.2.1/src/sd/domnode-expat.c:269: undefined reference to `XML_ErrorString'
collect2: ld returned 1 exit status
乍一看,它似乎缺少 libexpat.a,但 libexpat.a 位于构建机器上,并且 Eclipse 已配置为可以找到它。我们使用 --disable-shared 参数构建了 libexpat.a 到 ./configure,但没有成功。
有什么想法吗?
We are building a project that requires log4c to be linked in the static mode, the following is part of the linker error that is being generated.
/usr/local/lib/liblog4c.a(domnode-expat.o): In function `sd_domnode_read':
/log4c-1.2.1/src/sd/domnode-expat.c:316: undefined reference to `XML_ParserCreate'
/log4c-1.2.1/src/sd/domnode-expat.c:324: undefined reference to `XML_SetCommentHandler'
/log4c-1.2.1/src/sd/domnode-expat.c:325: undefined reference to `XML_SetUserData'
/log4c-1.2.1/src/sd/domnode-expat.c:327: undefined reference to `XML_Parse'
/log4c-1.2.1/src/sd/domnode-expat.c:355: undefined reference to `XML_ParserFree'
/log4c-1.2.1/src/sd/domnode-expat.c:328: undefined reference to `XML_GetErrorCode'
/log4c-1.2.1/src/sd/domnode-expat.c:328: undefined reference to `XML_ErrorString'
/usr/local/lib/liblog4c.a(domnode-expat.o): In function `sd_domnode_fread':
/log4c-1.2.1/src/sd/domnode-expat.c:242: undefined reference to `XML_ParserCreate'
/log4c-1.2.1/src/sd/domnode-expat.c:250: undefined reference to `XML_SetCommentHandler'
/log4c-1.2.1/src/sd/domnode-expat.c:251: undefined reference to `XML_SetUserData'
/log4c-1.2.1/src/sd/domnode-expat.c:258: undefined reference to `XML_GetBuffer'
/log4c-1.2.1/src/sd/domnode-expat.c:268: undefined reference to `XML_ParseBuffer'
/log4c-1.2.1/src/sd/domnode-expat.c:301: undefined reference to `XML_ParserFree'
/log4c-1.2.1/src/sd/domnode-expat.c:269: undefined reference to `XML_GetErrorCode'
/log4c-1.2.1/src/sd/domnode-expat.c:269: undefined reference to `XML_ErrorString'
collect2: ld returned 1 exit status
Off hand it seems to be missing libexpat.a, but libexpat.a is on the build machine and Eclipse is configured to find it. We have built libexpat.a with the --disable-shared parm to ./configure with no success.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
静态链接问题的解决方案是设置库到其他库的链接顺序
这应该允许 log4c 以静态模式链接。
The solution to the static link issue is to set the linking order of the libraries to other libs
This should allow log4c to link in the static mode.