gloox 1.0 编译问题解决

4055阅读 0评论2012-12-13 sxcong
分类:C/C++

1 编译环境是vc2008
2 编译时如果提示找不到某个.cpp,在工程-->解决方案里去掉该文件。
3 release编译问题:在项目常规里,这里原来是.exe,改成.dll。
4 release编译后如果找不到.lib,说明没有dllexport,简单的办法就是在macros.h前面位置加上
#define GLOOX_EXPORTS

原因在以后几行:

#if defined( _WIN32 ) && !defined( __SYMBIAN32__ )
#  if defined( GLOOX_EXPORTS ) || defined( DLL_EXPORT )
#    define GLOOX_API __declspec( dllexport )
#  else
#    if defined( GLOOX_IMPORTS ) || defined( DLL_IMPORT )
#      define GLOOX_API __declspec( dllimport )
#    endif
#  endif
#endif

#ifndef GLOOX_API
#  define GLOOX_API
#endif

最初什么都没有,#if和#else都进不去,所以dllexport 永远都没有走到。
debug里面在工程设置里面有。

补充一下:
客户端调用gloox的dll时,需要:
#define GLOOX_IMPORTS
理由同上。
上一篇:CentOS安装Lucene
下一篇:gloox 1.0 内存泄露问题