我正在尝试编译一个用 C++ 编写的程序。我收到此消息错误:
undefined reference to `escapeXMLChars(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'
我认为发生此错误是因为我使用的是 GCC 版本 5。所以我尝试将其降级到 4.8 并使用 gcc-4.8 编译程序。但我仍然收到此错误,这是输出:
g++-4.8 -m32 -Wall -o boomerang driver.o codegen/chllcode.o codegen/syntax.o util/util.o db/basicblock.o db/proc.o db/sslscanner.o db/cfg.o db/prog.o db/table.o db/statement.o db/register.o db/sslparser.o db/exp.o db/rtl.o db/sslinst.o db/insnameelem.o db/signature.o db/managed.o c/ansi-c-parser.o c/ansi-c-scanner.o boomerang.o log.o db/visitor.o db/dataflow.o db/xmlprogparser.o frontend/frontend.o frontend/njmcDecoder.o frontend/sparcdecoder.o frontend/pentiumdecoder.o frontend/sparcfrontend.o frontend/pentiumfrontend.o frontend/ppcdecoder.o frontend/ppcfrontend.o frontend/st20decoder.o frontend/st20frontend.o frontend/mipsdecoder.o frontend/mipsfrontend.o frontend/_8051frontend.o frontend/_8051decoder.o type/constraint.o type/type.o type/dfa.o loader/BinaryFileFactory.o transform/rdi.o transform/transformer.o transform/generic.o transform/transformation-parser.o transform/transformation-scanner.o db/AssHandler.o db/AssScanner.o -Wl,-rpath -Wl,"lib" -lfl -Llib -lgc -ldl -m32 -lBinaryFile -lexpat
db/proc.o: In function `UserProc::printDecodedXML()':
proc.cpp:(.text+0x4590): undefined reference to `escapeXMLChars(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'
我不知道为什么,我应该将 gcc 降级到旧版本吗?