但是做成静态库 ar cr tiny.a tinyxml.o tinystr.o tinyxmlerror.o tinyxmlparser.o
编译 g++ -o xmltest xmltest.cpp -L.-l tiny.a 就报错了
都是这一系列这样的错误,列出一部分,都是 “undefined reference to ”的错误
/tmp/cceTNVUr.o: In function `TiXmlString:perator+=(char const*)':
xmltest.cpp.text._ZN11TiXmlStringpLEPKc[TiXmlString:perator+=(char const*)]+0x23): undefined reference to `TiXmlString::append(char const*, unsigned int)'
/tmp/cceTNVUr.o: In function `TiXmlString:perator+=(TiXmlString const&)':
xmltest.cpp.text._ZN11TiXmlStringpLERKS_[TiXmlString:perator+=(TiXmlString const&)]+0x2e): undefined reference to `TiXmlString::append(char const*, unsigned int)'
/tmp/cceTNVUr.o: In function `TiXmlString:perator=(char const*)':
xmltest.cpp.text._ZN11TiXmlStringaSEPKc[TiXmlString:perator=(char const*)]+0x23): undefined reference to `TiXmlString::assign(char const*, unsigned int)'
/tmp/cceTNVUr.o: In function `TiXmlString:perator=(TiXmlString const&)':
xmltest.cpp.text._ZN11TiXmlStringaSERKS_[TiXmlString:perator=(TiXmlString const&)]+0x2e): undefined reference to `TiXmlString::assign(char const*, unsigned int)'
collect2: ld 返回 1