undefined reference

Cform 2007-10-03 10:52:31
编译时出错:
.o /e/pocobuild/Foundation/obj/MinGW/ia32/debug_shared/pcre_exec.o /e/pocobuild/Foundation/obj/MinGW/ia32/debug_shared/pcre_ord2utf8.o /e/pocobuild/Foundation/obj/MinGW/ia32/debug_shared/pcre_newline.o /e/pocobuild/Foundation/obj/MinGW/ia32/debug_shared/pcre_fullinfo.o /e/pocobuild/Foundation/obj/MinGW/ia32/debug_shared/pcre_xclass.o -L/e/pocobuild/lib/MinGW/ia32 -liphlpapi -lws2_32 -lpcre
Creating library file: e:/pocobuild/lib/MinGW/ia32/libPocoFoundationd.a
e:/pocobuild/Foundation/obj/MinGW/ia32/debug_shared/LoggingFactory.o(.text$_ZNK4Poco12InstantiatorINS_15EventLogChannelENS_7ChannelEE14createInstanceEv[Poco::Instantiator<Poco::EventLogChannel, Poco::Channel>::createInstance() const]+0x59): In function `ZN4Poco12InstantiatorINS_17FormattingChannelENS_7ChannelEED1Ev':
e:/poco-1.3.1-data/Foundation/include/Poco/Instantiator.h: undefined reference to `Poco::EventLogChannel::EventLogChannel()'
e:/pocobuild/Foundation/obj/MinGW/ia32/debug_shared/LoggingFactory.o(.text$_ZNK4Poco12InstantiatorINS_21WindowsConsoleChannelENS_7ChannelEE14createInstanceEv[Poco::Instantiator<Poco::WindowsConsoleChannel, Poco::Channel>::createInstance() const]+0x59):e:/poco-1.3.1-data/Foundation/include/Poco/Instantiator.h: undefined reference to `Poco::WindowsConsoleChannel::WindowsConsoleChannel()'
e:/pocobuild/Foundation/obj/MinGW/ia32/debug_shared/SyslogChannel.o(.text+0x6e4): In function `ZN4Poco13SyslogChannel4openEv':
e:/poco-1.3.1-data/Foundation/src/SyslogChannel.cpp:76: undefined reference to `openlog'
e:/pocobuild/Foundation/obj/MinGW/ia32/debug_shared/SyslogChannel.o(.text+0x702): In function `ZN4Poco13SyslogChannel5closeEv':
e:/poco-1.3.1-data/Foundation/src/SyslogChannel.cpp:85: undefined reference to `closelog'
e:/pocobuild/Foundation/obj/MinGW/ia32/debug_shared/SyslogChannel.o(.text+0x762): In function `ZN4Poco13SyslogChannel3logERKNS_7MessageE':
e:/poco-1.3.1-data/Foundation/src/SyslogChannel.cpp:94: undefined reference to `syslog'

看样子是是缺少可查了很久
第一我包含了<syslog.h>//这个只有openlog(),closelog()的声明,缺没有定义,
我不知道到底怎么回事?是不是g++时 没有带什么时候-l参数如果缺少库是缺那个我也不知道,望高手指点
...全文
316 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
ITsignal 2007-11-11
  • 打赏
  • 举报
回复
应该是makefile中,objs没有加入相应模块,连接的时候出问题了。
飞哥 2007-11-11
  • 打赏
  • 举报
回复
没有找到实现

如果是库要连接
如果是cpp需要编成o
Cform 2007-11-11
  • 打赏
  • 举报
回复
我下载了gnuwin32的glibc库 编译时用了-lgw32c//(原库名为libgw32c.a这是gnuwin32的glibc库名,但是没用啊
lddLinan 2007-10-08
  • 打赏
  • 举报
回复
syslog is a system call in linux/unix system, mingw possibly don't supply it. You can just redefined those function, remapping them to whatever you want.
nickshen_qidian 2007-10-08
  • 打赏
  • 举报
回复
syslog应该属于glibc中API.
尝试一下在e:/pocobuild/lib/MinGW/ia32/libPocoFoundationd.a
的makefile中加入glibc
WinWing 2007-10-04
  • 打赏
  • 举报
回复
不清楚,但看起来是没连接到必要的库
晨星 2007-10-03
  • 打赏
  • 举报
回复
syslog用到什么库,函数使用手册里查不到么?
独孤过儿 2007-10-03
  • 打赏
  • 举报
回复
方便贴代码吗?谢谢

64,654

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧