[Botan-devel] Botan 1.6.0 - debug build fails (VS2005)

Jack Lloyd lloyd at randombit.net
Sat Dec 16 10:44:25 EST 2006


Hi Erik,

Sorry, totally forgot I was going to look into this before.

I've been poking around, and it looks like the problem is in the
definition of some debug macros that make assumptions they shouldn't
be making about types kept in STL containers. It seems safe to say
that this problem can be worked around (probably at the cost of some
uglification of mem_pool.cpp, not like that file wasn't ugly enough
already), but the most straightforward workaround is to put an '#undef
_DEBUG' before any of the #includes in that file. It was actually
fairly easy to isolate; I've got a 10 line testcase that does the same
thing WRT failing with _DEBUG, if you're interested in seeing it
and/or passing it on to Microsoft.

There probably is a more precise macro to just toggle off the iterator
checks while leaving the other debug goop, but grotting through the
Visual Studio headers with notepad and no grep is not fun.

-Jack

On Sat, Dec 16, 2006 at 02:55:15PM +0100, Erik Loman wrote:
> Hi Jack, 
> 
> I've just downloaded Botan 1.6.0 and tried to compile it using Visual Studio
> 2005 (Professional) and I still get the same error (mem_pool.cpp) when
> compiling a debug build. I need a debug build in order to step through my
> projects (12+). I want to use build 1.6 (or 1.5) but I can't get them to
> compile a debug build.
> 
> I edited the following line in the makefile (which was created with "perl
> configure.pl msvc-windows-x86 --module-set=win32" ): 
> 
> LANG_FLAGS = /EHsc /GR /D_CONSOLE /MDd /D_DEBUG
> 
> Notice that I simply added "/MDd /D_DEBUG". The /MDd is causing the problem
> in mem_pool.cpp. Also trying to compile using /MTd results in the same
> error.
> 
> I've attached the makefile to this e-mail so you can see for yourself. Also
> in the zip file is the output from nmake.
> 
> On a side note: Visual Studio 2005 Service Pack 1 is released (also for
> Express editions). I've also tried compiling a debug Botan library with this
> service pack installed, but that also fails. 
> 
> Please help.
> 
> Best regards,
> Erik Loman
> 
> 
> -----Original Message-----
> From: botan-devel-bounces at randombit.net
> [mailto:botan-devel-bounces at randombit.net] On Behalf Of Jack Lloyd
> Sent: maandag 27 november 2006 16:58
> To: Botan development list
> Subject: Re: [Botan-devel] Botan 1.5.12 and VS2005
> 
> On Fri, Nov 24, 2006 at 09:35:50PM +0100, Erik Loman wrote:
> 
> > The compiler doesn't complain if I compile Botan 1.5.12 in Release mode.
> > 
> > After some heavy searching on the internet I found that there could to 
> > be a problem with the STL include files that got shipped with VS2005 
> > RTM. Search with Google for _Debug_lt.
> > 
> > Can someone please confirm this is a problem related to VS2005 or even 
> > better, provide a workaround so I can use 1.5.12 in my projects. I 
> > hope this problem gets fixed before 1.5.x gets declared stable.
> 
> Interesting. I'll check this out later today (sorry about not replying
> sooner, was out of town visiting friends all weekend). I'm using
> VS2005 express edition, which hopefully is close enough that I'll be able to
> replicate this.
> 
> BTW, I'm not aware of anyone using Botan on 64-bit Windows. My x86-64
> machine is currently Linux only, and will probably remain that way until the
> Xen patched kernels resync with the mainline so I can virtualize Windows
> while keeping the hardware support which is only available in very recent
> releases.
> 
> -Jack
> _______________________________________________
> botan-devel mailing list
> botan-devel at randombit.net
> http://www.randombit.net/mailman/listinfo/botan-devel


> _______________________________________________
> botan-devel mailing list
> botan-devel at randombit.net
> http://www.randombit.net/mailman/listinfo/botan-devel




More information about the botan-devel mailing list