0
  • 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;
}
pcunite
  • 1,197
  • 15
  • 23

1 Answers1

3

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

gvaf
  • 46
  • 2
  • Thank you for your help. I skipped using Botan and went with a CryptoAPI/OpenSSL class. I can't really verify your answer so I just accept it. – pcunite Nov 05 '11 at 13:47
  • I am running into the same problem (102 errors, too - at least...) an I have set it to not include any other header.It's certainly not min/max (though this was my first guess, too, and the first error, curiously, is at a std::min - just not the first occurence thereof) – peterchen Jan 07 '16 at 13:27
  • What helped for me was adding `using std::min; using std::max` on botan_all.cpp right after the includes, and replacing all `std::min`, `std::max` with `min`, `max` – peterchen Jan 07 '16 at 13:36