读书人

gloox,编译有关问题。

发布时间: 2012-02-08 19:52:21 作者: rapoo

gloox,编译问题。请教高手..
gloox 库 vs2005下,release下编译成dll和lib后在程序中调用。

在程序中编译出现
>------ 已启动生成: 项目: TestGloox, 配置: Release Win32 ------
1>正在链接...
1>IMSession.obj : error LNK2001: 无法解析的外部符号 "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const gloox::EmptyString" (?EmptyString@gloox@@3V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@B)
1>IMSession.obj : error LNK2001: 无法解析的外部符号 "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const gloox::GLOOX_VERSION" (?GLOOX_VERSION@gloox@@3V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@B)
1>../bin/win.exe : fatal error LNK1120: 2 个无法解析的外部命令
1>生成日志保存在“file://e:\worspace\TestGloox\Release\BuildLog.htm”
1>TestGloox - 3 个错误,0 个警告
========== 生成: 0 已成功, 1 已失败, 0 最新, 0 已跳过 ==========


将gloox.cpp加入项目后,编译通过。但出现

错误提示框:

windows已在XX.exe中触发一个断点
其原因可能是堆被损坏,这也说明XX.exe中或它所加载的任何DLL中有bug.

[解决办法]

是两个变量
这是找到声明
没找到定义
你看看是不是什么库没有链接
[解决办法]

探讨
在gloox.cpp中有
const std::string GLOOX_VERSION = "1.0";

那你看一下gloox.cpp 编译了没有
应该是没有生成gloox.obj

读书人网 >C++

热点推荐