yyq1w2e3 发表于 2012-10-24 00:16

poco库编译成ARM格式,在应用时出问题(非代码问题),求解!!!

环境: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::Priority)':
/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::Priority)'
./src/poco.o: In function `Poco::DateTimeFormatter::format(Poco::DateTime 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::DateTimeFormatter::append(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, Poco::DateTime 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+0x28): 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: *** 错误 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+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+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

这到底需要什么库的支持 或者说 这个需要库的调用顺序有要求? 请各位,大胆回答,多多指点。

dfhf2007 发表于 2012-10-24 13:18

这个库你交叉编译后安装到哪里了???是不是找不到库的路径。。。。

yyq1w2e3 发表于 2012-10-26 21:30

回复 2# dfhf2007

谢谢dfhf2007 的回答,我放在/usr/local/lib 下的。

这会不会和库调用的顺序有关? 或者还需要其他的库支持,因为编译成x86格式后,调用是没有问题的,证明ubuntu本身自带的库里有POCO库需要的支持库。
编译成arm格式后,调用出错,这说明没有arm格式的这个库。
   

yyq1w2e3 发表于 2012-10-29 22:41

怎么没有人回啊 知道的请提出自己的答案或者疑问 ! 谢谢各位
页: [1]
查看完整版本: poco库编译成ARM格式,在应用时出问题(非代码问题),求解!!!