- 论坛徽章:
- 0
|
环境:ubuntu10.4
编译链:4.2.2-eabi
IDE:eclipse linux
编译poco库时,先使用默认配置,编译成x86格式,然后在eclipse中编译poco代码,没有问题。
然后配置成ARM-Linux配置文件。./configure --config=ARM=Linux 然后编辑,安装,没有问题。
然后再eclipse中编译代码,并将编译工具变为arm-linux-g++。出现以下错误信息:
**** Build of configuration Debug for project poco ****
make all
Building file: ../src/poco.cpp
Invoking: GCC C++ Compiler
/usr/local/arm/4.2.2-eabi/usr/bin/arm-linux-g++ -I/usr/local/include/ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/poco.d" -MT"src/poco.d" -o"src/poco.o" "../src/poco.cpp"
Finished building: ../src/poco.cpp
Building target: poco
Invoking: GCC C++ Linker
/usr/local/arm/4.2.2-eabi/usr/bin/arm-linux-g++ -L/usr/local/lib -o"poco" ./src/poco.o -lPocoFoundation -lCppUnit -lPocoUtil -lPocoNet -lPocoXML
./src/poco.o: In function `HTTPTimeServer::handleHelp(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const& ':
/opt/TE/poco/Debug/../src/poco.cpp:139: undefined reference to `Poco::Util::HelpFormatter::setCommand(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const& '
/opt/TE/poco/Debug/../src/poco.cpp:140: undefined reference to `Poco::Util::HelpFormatter::setUsage(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const& '
/opt/TE/poco/Debug/../src/poco.cpp:142: undefined reference to `Poco::Util::HelpFormatter::setHeader(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const& '
/opt/TE/poco/Debug/../src/poco.cpp:143: undefined reference to `Poco::Util::HelpFormatter::format(std::basic_ostream<char, std::char_traits<char> >& const'
./src/poco.o: In function `HTTPTimeServer::defineOptions(Poco::Util::OptionSet& ':
/opt/TE/poco/Debug/../src/poco.cpp:132: undefined reference to `Poco::Util::Option::Option(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)'
./src/poco.o: In function `Poco::Logger::log(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Poco::Message: riority)':
/usr/local/include/Poco/Logger.h:605: undefined reference to `Poco::Message::Message(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Poco::Message: riority)'
./src/poco.o: In function `Poco: ateTimeFormatter::format(Poco: ateTime const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)':
/usr/local/include/Poco/DateTimeFormatter.h:189: undefined reference to `Poco: ateTimeFormatter::append(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, Poco: ateTime const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
./src/poco.o: In function `TimeRequestHandler::handleRequest(Poco::Net::HTTPServerRequest&, Poco::Net::HTTPServerResponse& ':
/opt/TE/poco/Debug/../src/poco.cpp:56: undefined reference to `Poco::Net::HTTPMessage::setContentType(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const& '
./src/poco.o: In function `Poco::MutexImpl::lockImpl()':
/usr/local/include/Poco/Mutex_POSIX.h:82: undefined reference to `Poco::SystemException::SystemException(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
./src/poco.o: In function `Poco::MutexImpl::unlockImpl()':
/usr/local/include/Poco/Mutex_POSIX.h:101: undefined reference to `Poco::SystemException::SystemException(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
./src/poco.o: In function `HTTPTimeServer::main(std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const& ':
/opt/TE/poco/Debug/../src/poco.cpp:153: undefined reference to `Poco::Util::AbstractConfiguration::getInt(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int) const'
/opt/TE/poco/Debug/../src/poco.cpp:156: undefined reference to `Poco::Util::AbstractConfiguration::getString(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const& const'
./src/poco.o .rodata._ZTV14HTTPTimeServer[vtable for HTTPTimeServer]+0x2 : undefined reference to `Poco::Util::Application::handleOption(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
collect2: ld returned 1 exit status
make: *** [poco] 错误 1
我把ARM-Linux的配置文件改了后再编译成动态库
arm-linux-gcc -o poco poco.cpp -lstlport -lPocoUtil -lPocoNet -lPocoFoundation -lPocoXML -lCppUnit
还是出现了没有定义的错误情况,错误如下,你是怎么解决这个问题的啊?
错误信息:
/tmp/ccLhGsAI.o: In function `Poco::MutexImpl::lockImpl()':
poco.cpp .text._ZN4Poco9MutexImpl8lockImplEv[Poco::MutexImpl::lockImpl()]+0x7c): undefined reference to `Poco::SystemException::SystemException(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
/tmp/ccLhGsAI.o: In function `Poco::MutexImpl::unlockImpl()':
poco.cpp .text._ZN4Poco9MutexImpl10unlockImplEv[Poco::MutexImpl::unlockImpl()]+0x7c): undefined reference to `Poco::SystemException::SystemException(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
collect2: ld returned 1 exit status
这到底需要什么库的支持 或者说 这个需要库的调用顺序有要求? 请各位,大胆回答,多多指点。 |
|