Ubuntu 未定义的引用错误

Ubuntu undefined reference error

我正在尝试编译用 C++ 编写的程序。我收到此消息错误:

undefined reference to `escapeXMLChars(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'

我搜索并找到了这个 post:

我假设这个错误是因为我使用的是GCC version 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 降级到旧版本吗?

我的问题解决了,终于编译成功了。将我的配置调整为:

./configure --host=i686-linux-gnu "CFLAGS=-m32" "CXXFLAGS=-m32" "LDFLAGS=-m32" "CC=gcc -std=c++11 -D_GLIBCXX_USE_CXX11_ABI=0" "CXX=g++ -std=c++11 -D_GLIBCXX_USE_CXX11_ABI=0"