I'm sorry to revive this old thread but I HAD to thank you.
I've been working on porting some C++ code from Linux to Windows and
was getting assertion failures when dealing with vectors.
I spent countless hours trying to fix the problem but could not find a
solution. Adding the preprocessor defines you specified fixed my
Thank you so very much!
On Jul 16, 5:14 am, Mr Moose <stephan.men...@gmail.com> wrote:
> It is found!
> After 4 interesting days of debugging the bastard I realized that I
> rercently had to add 3 preprocessor defines to my build system:
> If they are missing, many things[tm] won't work properly in debug
> build. Things such as several boost components for instance. So I set
> them defines and forgot about them. Hence the crashes in libprotobuf.
> Now I added same defines to the libprotobuf target in the .sln file of
> 2.1.0. After a complete rebuild things work fine.
> Which one of the defines was responsible and why remains obscure but I
> tend to think _SECURE_SCL might alter headers and type definitions to
> the using app and the lib are using differently sized types.
> On 16 Jul., 09:29, Mr Moose <stephan.men...@gmail.com> wrote:
> > OK, just for the records: Now I can be really sure. I've deleted
> > everything that remotely resembles a release build and changed my
> > build system so it won't create any and work without. And still the
> > bug occurs. So I don't think it is related to Microsoft runtime
> > issues.
> > Cheers,
> > Stephan
> > On 16 Jul., 08:33, Mr Moose <stephan.men...@gmail.com> wrote:
> > > Kenton,
> > > well, I checked this over and over again and I really think I did make
> > > sure. I also checked the linker settings for all other libs I link
> > > against and they are all set to Debug. Also, this is the same build
> > > environment I used with 2.0.3. where it did work. On the other hand,
> > > it's Microsoft so you can never be really sure what's going on.
> > > Anyway, is there any other possible explanation for said crashes?
> > > Cheers,
> > > Stephan
> > > On 15 Jul., 20:25, Kenton Varda <ken...@google.com> wrote:
> > > > Did you make sure to compile your debug build against a debug build of
> > > > libprotobuf? MSVC fails miserably when trying to mix and match debug
> > > > vs.
> > > > release, apparently because the STL classes have different
> > > > representations
> > > > between the two.
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To post to this group, send email to email@example.com
To unsubscribe from this group, send email to
For more options, visit this group at