Qt 不适用于 Botan_v1.10.1 库
我一直在尝试让 Qt 4.7.3 与最新的 Botan v1.10.1 库一起使用。
有一个适用于 Windows 的 Botan 二进制文件,但 *.dll 文件似乎仅适用于 MS Visual Studio。 所以我尝试用mingw32编译Botan,这样我就可以获得Qt兼容的*.dll和*.a文件。
一些额外信息:
-Windows 7 64位。
-尝试在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 -再做一次。这次它编译了更多并陷入了这个错误。
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
我无法克服这个错误。任何帮助将不胜感激。
I've been trying to get Qt 4.7.3 to work with the newest Botan v1.10.1 libraries.
There is a Botan binary for Windows but it seems that the *.dll files are only for MS Visual Studio.
So I tried to compile Botan with mingw32 so that I can get Qt compatible *.dll and *.a files.
Some Extra Info:
-Windows 7 64bit.
-Tried to compile in 32bit mode.
-Qt is newest everything and works great, installed in 32bit mode.
-Botan is v1.10.1 for x86 Windows.
I opened the Qt command prompt and issued the following command.
configure.py --cc=gcc --cpu=x86
This command generated a Makefile.
Then I usued this command.
mingw32-make
This command generates the following error after a few minutes of running.
C:\Botan-1.10.1\src\utils\time.cpp: In function 'tm
Botan::::do_gmtime(time_t)':
C:\Botan-1.10.1\src\utils\time.cpp:55: error: 'gmtime_s' was not declared in this scope
mingw32-make: * [build\lib\time.obj] Error 1
I opened C:\Botan-1.10.1\src\utils\time.cpp and changed this
#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
to this
/*#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
Then I ran mingw32-make again. This time it compiled more and got stuck on this error.
C:\Botan-1.10.1>mingw32-make process_begin: CreateProcess(NULL, rm -f
libbotan-1.10.a, ...) failed. make (e=2): The system cannot find the
file specified. mingw32-make: * [libbotan-1.10.a] Error 2
I can't get beyond this error. Any help would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以从 Qt Creator 源代码树中提取 botan 并使用 qmake 和 gcc 来构建它。
或者,使用 MinGW-w64 的 gendef 或 MinGW.org 等效项从 DLL 生成 .def 文件,并使用 dlltool 创建导入库。
You can extract botan from the Qt Creator source tree and use qmake and your gcc to build it.
Alternatively, use MinGW-w64's gendef or the MinGW.org equivalent to generate a .def file from the DLL, and use dlltool to create an import library.