How to use Botan Amalgamation files and VS2008

倾然丶 夕夏残阳落幕 提交于 2019-12-08 13:37:14

问题


  • Clean install of Windows XP SP3
  • Install Python 2.7.2
  • Extract Botan 1.10.1 to the desktop
  • Run configure.py --cc=msvc --disable-shared --gen-amalgamation
  • Copy botan_all.h and botan_all.cpp to my dev workstation
  • Make a new project Win32 console project in VS2008

This gives me 102 errors ... anyone using this library?

#include "botan_all.h"
int main(int argc, char *argv[])  
{
    return 0;
}

回答1:


The problem is your project is a windows application and includes windows.h, windows.h includes macros for min and max.

The solution is to define #define NOMINMAX You can do through the project's property pages > C/C++ > Preprocessor > Preprocessor definitions

Also, add #define BOTAN_DLL in botan_all.h to avoid error at least in version 1.10.1



来源:https://stackoverflow.com/questions/7533703/how-to-use-botan-amalgamation-files-and-vs2008

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!