编译C++的错误提示 不指定

root , 2009/04/17 23:13 , C/C++ , 评论(0) , 阅读(5848) , Via 本站原创 | |
config.h

main.cpp

引用

./configure通过,make时提示:
............
nagios_rsync.o: In function `~TiXmlDocument':
src/tinyxml.h:1401: undefined reference to `vtable for TiXmlDocument'
src/tinyxml.h:1401: undefined reference to `TiXmlNode::~TiXmlNode()'
nagios_rsync.o: In function `CConfig':
src/config.h:33: undefined reference to `TiXmlDocument::TiXmlDocument(char const*)'
src/config.h:36: undefined reference to `TiXmlDocument::LoadFile(TiXmlEncoding)'
nagios_rsync.o: In function `TiXmlNode::FirstChildElement(char const*)':
src/tinyxml.h:673: undefined reference to `TiXmlNode::FirstChildElement(char const*) const'
collect2: ld returned 1 exit status
make: *** [nagios_rsync] Error 1
*** Exited with status: 2 ***

因为用到tinyxml包,程序找不到其它相关模块。
在config.h中添加:

就正常了。
Tags:
发表评论

昵称

网址

电邮

打开HTML 打开UBB 打开表情 隐藏 记住我 [登入] [注册]