Re: [Botan-devel] Help with Windows build
Brought to you by:
randombit
|
From: Jack L. <ll...@ac...> - 2003-06-05 22:29:40
|
On Thu, 5 Jun 2003, Jeff B wrote: > I'm trying to get the 1.2.4 build to compile with Visual Studio .NET 2003 > (ver 7) and I'm having a bit of trouble. Here's what I've done so far: > > > 1. D/l 1.2.4 source > (http://prdownloads.sourceforge.net/opencl/Botan-1.2.4.tgz) and unzipped > 2. Ran configure.pl (I believe I used "perl configure.pl msvc-windows-i486") > 3. ran VS, created a Visual C++ Win32 console application > 4. added the contents of Botan's SRC directory to the new project > 5. Went into the project's settings and > a) Turned off using precompiled headers > b) Added the Botan\include path to the "include additional directories" > setting. > 6. Rebuilt my test project Hmm, I've never tried this method before, but I imagine it might run into trouble. Here's the prefered method: Steps 1/2 OK. 3. run 'nmake' to build libbotan.lib 4. Add Botan's base directory to the library search path in VC 4a. Tell the compiler to link with libbotan.lib Step 5/6 OK. > OK, first issue: There are a _LOT_ of compile warnings. One of the > warnings, C4290, found in base.h, line 42, > void set_key(const byte[], u32bit) throw(Invalid_Key_Length); > > is about exception specification being ignored. Doing a search on C4290 in > VS, I found "Handling Exceptions, part 6" in Deep C++, which goes on to say > that VS ignores the exception specification at run time. Lovely, I thought > VS .NET 2003 was supposed to bring conformance to ANSI C++. Well, in this case it's not really a warning - it's just the compiler spouting off about how much it sucks (exception specfications are well established, the MSDN page I found about this warning is basically lying). I have always been under the impression that compilers would warn about problems in the code, not problems in the compiler. Anyway... > Is this warning a known issue or is my configure.pl settings wrong, or do I > need to set any additional parameters in the project? I can just silence > the warning, but it seems dangerous. OK, so much for the warnings. Moving > on... I would say either use a pragma to ignore this specific 'warning', or lower your warning level down to 2 so it never shows up. I don't see much of a way out of this in the general case, besides massive code modifications. I'll have config.h include a pragma disabling this warning in 1.2.5 - I honestly see no useful reason for it to exist. > 7. At the end of the build, I get 3 errors pertaining to get_ciph.cpp, line > 87, which is > > Keyed_Filter* get_cipher(const std::string& algo_spec, Cipher_Dir direction) > { > struct Invalid_Combination : public Exception > { > Invalid_Combination(const std::string& mode, const std::string& pad) : > Exception("Invalid mode/padding pair: " + mode + "/" + pad) {} > }; > > The compiler doesn't like > Exception("Invalid mode/padding pair: " + mode + "/" + pad) > > > Are these known issues? Hmmm, I hadn't heard about this second problem at all. Seems to depends on the exact version of VC7 used (THANK YOU MICROSOFT). I'll try to figure out a workaround for the next release. > Are my configure options correct? Yes, but you should build the library as a seperate entity, rather than building all the source as part of your application. -Jack |