codeblocks和poco库配合问题

supervila 2010-07-12 11:24:54
最近想做跨平台开发,选用了poco库。首先在Windows下测试,过程是这样的:
1> 使用VS2008编译poco库
2> 安装Code::blocks10.05,然后设置工作环境,设置头文件搜索路径和链接搜索路径
在“settings”—>“Complier and Debugger”中设置
3> 然后在工程中设置使用的库,“project”—>“Build Options”—>“Link Settings”中,添加要链接的库
PocoFoundationd.lib
4> 从示例中拷贝些简单的代码,编译,错误提示如下:
obj\Debug\main.o:main.cpp|| undefined reference to `Poco::LocalDateTime::LocalDateTime()'|
obj\Debug\main.o:main.cpp|| undefined reference to `Poco::DateTimeFormat::ISO8601_FORMAT'|
obj\Debug\main.o:main.cpp|| undefined reference to `Poco::DateTime::DateTime()'|
obj\Debug\main.o:main.cpp|| undefined reference to `Poco::DateTimeFormat::ISO8601_FORMAT'|
obj\Debug\main.o:main.cpp|| undefined reference to `Poco::DateTimeParser::parse(std::string const&, std::string const&, Poco::DateTime&, int&)'|
obj\Debug\main.o:main.cpp|| undefined reference to `Poco::DateTime::makeUTC(int)'|
obj\Debug\main.o:main.cpp|| undefined reference to `Poco::LocalDateTime::LocalDateTime(int, Poco::DateTime const&)'|
obj\Debug\main.o:main.cpp|| undefined reference to `Poco::LocalDateTime::~LocalDateTime()'|
obj\Debug\main.o:main.cpp|| undefined reference to `Poco::DateTime::~DateTime()'|
obj\Debug\main.o:main.cpp|| undefined reference to `Poco::DateTime::~DateTime()'|
obj\Debug\main.o:main.cpp|| undefined reference to `Poco::LocalDateTime::~LocalDateTime()'|
obj\Debug\main.o:main.cpp|| undefined reference to `Poco::LocalDateTime::~LocalDateTime()'|
int)]+0x7d)||undefined reference to `Poco::DateTimeFormatter::append(std::string&, Poco::DateTime const&, std::string const&, int)'|
||=== Build finished: 13 errors, 0 warnings ===

看起来是没有链接到指定的库,几乎试了所有的设置,均无法解决。
...全文
332 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
supervila 2010-07-12
  • 打赏
  • 举报
回复
很清楚了。多谢老邓。。结贴
soulzbg 2010-07-12
  • 打赏
  • 举报
回复
二楼正解
sujiewen 2010-07-12
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 supervila 的回复:]

多谢老邓回复。

也就是说:windows下 VC编译出的库和mingw+gcc编译出的库是不兼容的?
[/Quote]

http://www.cnblogs.com/shiweifu/archive/2009/11/26/1611561.html

你看看这个就知道了
supervila 2010-07-12
  • 打赏
  • 举报
回复
多谢老邓回复。

也就是说:windows下 VC编译出的库和mingw+gcc编译出的库是不兼容的?
老邓 2010-07-12
  • 打赏
  • 举报
回复
或者,在Code::Blocks里建工程的时候,选择VC编译器。
老邓 2010-07-12
  • 打赏
  • 举报
回复
因为Code::Blocks默认安装的是GCC编译器。
而你的库是vc编译出来的。
这是不通用的!

换成GCC编译poco库。

24,855

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 工具平台和程序库
社区管理员
  • 工具平台和程序库社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧