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中添加:
就正常了。
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中添加:
就正常了。