问题
- 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