免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3299 | 回复: 3
打印 上一主题 下一主题

[驱动] poco库编译成ARM格式,在应用时出问题(非代码问题),求解!!! [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-10-24 00:16 |只看该作者 |倒序浏览
环境: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

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

论坛徽章:
0
2 [报告]
发表于 2012-10-24 13:18 |只看该作者
这个库你交叉编译后安装到哪里了???是不是找不到库的路径。。。。

论坛徽章:
0
3 [报告]
发表于 2012-10-26 21:30 |只看该作者
回复 2# dfhf2007

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

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

论坛徽章:
0
4 [报告]
发表于 2012-10-29 22:41 |只看该作者
怎么没有人回啊 知道的请提出自己的答案或者疑问 ! 谢谢各位
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP