Qt不适用于Botan_v1.10.1库

时间:2011-11-24 18:21:59

标签: qt gcc mingw mingw32 botan

我一直在努力让Qt 4.7.3与最新的Botan v1.10.1库一起使用。

Windows有一个Botan二进制文件,但似乎* .dll文件仅适用于MS Visual Studio。 所以我尝试使用mingw32编译Botan,这样我就可以获得Qt兼容* .dll和* .a文件。

一些额外信息:
-Windows 7 64bit。
- 尝试以32位模式编译 -Qt是最新的一切,效果很好,安装在32位模式下 -Botan是x86 Windows的v1.10.1。

我打开了Qt命令提示符并发出了以下命令。

configure.py --cc=gcc --cpu=x86

此命令生成了一个Makefile。

然后我发了这个命令。

mingw32-make

此命令在运行几分钟后生成以下错误。

  

C:\ Botan-1.10.1 \ src \ utils \ time.cpp:在函数'tm中   牡丹:::: do_gmtime(time_t的)':       C:\ Botan-1.10.1 \ src \ utils \ time.cpp:55:错误:'gmtime_s'未在此范围内声明       mingw32-make: * [build \ lib \ time.obj]错误1

我打开了C:\ Botan-1.10.1 \ src \ utils \ time.cpp并更改了此

#if defined(BOTAN_TARGET_OS_HAS_GMTIME_S)
   gmtime_s(&tm, &time_val); // Windows
#elif defined(BOTAN_TARGET_OS_HAS_GMTIME_R)
   gmtime_r(&time_val, &tm); // Unix/SUSv2
#else
   std::tm* tm_p = std::gmtime(&time_val);
   if (tm_p == 0)
      throw Encoding_Error("time_t_to_tm could not convert");
   tm = *tm_p;
#endif  

到这个

/*#if defined(BOTAN_TARGET_OS_HAS_GMTIME_S)
   gmtime_s(&tm, &time_val); // Windows
#elif defined(BOTAN_TARGET_OS_HAS_GMTIME_R)
   gmtime_r(&time_val, &tm); // Unix/SUSv2
#else*/
   std::tm* tm_p = std::gmtime(&time_val);
   if (tm_p == 0)
      throw Encoding_Error("time_t_to_tm could not convert");
   tm = *tm_p;
//#endif

然后我又跑了mingw32-make。这次它编译得更多并且卡在这个错误上。

  

C:\ Botan-1.10.1> mingw32-make process_begin:CreateProcess(NULL,rm -f   libbotan-1.10.a,...)失败了。 make(e = 2):系统找不到   文件指定。 mingw32-make: * [libbotan-1.10.a]错误2

我无法超越这个错误。任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:1)

你可以从Qt Creator源代码树中提取botan并使用qmake和你的gcc构建它。

或者,使用MinGW-w64的gendef或MinGW.org等效文件从DLL生成.def文件,并使用dlltool创建导入库。