[Botan-devel] Concise MSVS Build Instructions?

larry_lindstrom at comcast.net larry_lindstrom at comcast.net
Thu Jun 3 01:38:50 EDT 2010


Hello Folks: 

Thank You Jack Lloyd, and anybody else who has contributed to Botan. 

I'm a newbie to Botan, and not particularly knowledgeable on the subject of cryptology. 

Here is the problem, which you've probably seen a hundred times before, a detailed and boring story of how I got here follows if you need to see that: Or just direct me to the "Building and using Botan in Windows for Dummies" page . 

Botan seems to build like a dream. 

I''ve attempted to build Botan 1.8.8 with Visual Studio 2008 Pro running on Windows XP pro. Soon I'll be turning to 7 ultimate / 64 for my development. My intention is to be able to build and test 32 and 64 bit apps. 

When building a very simple C++ program with Visual Studio 2008 Pro I have the following problems: 

First a series of warning messages that look like these: 

1>C:...\headers\botan/symkey.h(43) : warning C4251: 'Botan::OctetString::bits' : class 'Botan::SecureVector<T>' needs to have dll-interface to be used by clients of class 'Botan::OctetString' 
1> with 
1> [ 
1> T=Botan::byte 
1> ] 
1>C:...\headers\botan/sym_algo.h(49) : warning C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow) 

Then a bunch of link errors that look like these: 

1>Linking... 
1>msvcprt.lib(MSVCP90.dll) : error LNK2005: "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl std::operator+<char,struct std::char_traits<char>,class std::allocator<char> >(char const *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??$?HDU?$char_traits at D@std@@V?$allocator at D@1@@std@@YA?AV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@0 at PBDABV10@@Z) already defined in libbotan.lib(stream_cipher.obj) 

1>msvcprt.lib(MSVCP90.dll) : error LNK2005: "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl std::operator+<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,char const *)" (??$?HDU?$char_traits at D@std@@V?$allocator at D@1@@std@@YA?AV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@0 at ABV10@PBD at Z) already defined in libbotan.lib(stream_cipher.obj) 

1>msvcprt.lib(MSVCP90.dll) : error LNK2005: "protected: char const * __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::_Myptr(void)const " (?_Myptr@?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@IBEPBDXZ) already defined in libbotan.lib(stream_cipher.obj) 

What am I doing wrong? 

-------------------------------------------------------- 

How I got here: 

I unpacked Botan on my Solaris system and copied the tar file to my XP machine, where I ran tar with no apparent problems. 

The documentation that accompanies 1.8.8 seems a bit dated. For example it says to run configure.pl with Perl, but the script informs the user that the Perl script is deprecated and recommends using Python to run configure.py, 

To any other newbies reading this, at this time and for Botan version 1.8.8, use Python 2.6.5, not 3.1.2. 

I put together the following batch file to build Botan: 

call "C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat" 
python configure.py --cc=msvc --os=windows 
nmake 
nmake check 

The output was redirected to a file and everything seems fine. No errors or warnings. 

I copy libbotan.lib to a folder named "botan\release" in a folder I use for all of the general purpose libraries I build or download. I copy the header files into a folder called "headers\botan" in the same utilities folder. I choose not to follow the directions for placing the lib file in the same folder as the headers. 

So let's build a simple app. I'll be using the samples from the Botan site, starting with first try. 

Before attempting anything useful, I create a project and build a simple WinMain() WinProc() C++ source file. 

In the properties pages I identify the folder with the libbotan.lib in the "Additinal Library Directories". "libbotan.lib is inserted in the Additional Dependencies section. 

I attempt a build... 

And the build fails. 

------------------------- 

Should I expect to see a DLL after running this script? I searched, and found no DLLs in the Botan folder. There is a file at src/build-data/cc/msvc.txt that looks like it might be providing some direction on building a DLL, but I don't know Python, or nmake, so I don't know if I need to do something with this file. 

I'm happy with either a static or dynamic Botan library. 

Visual Studio 2008 Pro uses multi-threading libraries by default. Some of my apps are multi-threaded, so I use this default. 

I'd like to be able to build debug, release, 32 bit and 64 bit libraries. I'll be using Win 7/64 for development and I'm not sure if the configure script will assume I want just a 64 bit build of Botan. So I'd like to see what arguments I send to configure.py for these different builds. 

Again, thank you Jack Lloyd, and others, for this library. 

Larry 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.randombit.net/pipermail/botan-devel/attachments/20100603/601ff66a/attachment.html>


More information about the botan-devel mailing list