Make sure you link your client .exe to the same C runtime as
libprotobuf.dll (which should be the multi-threaded dll version). I
ran into this same exception and got it to work by making that change.
For debug builds use /MDd switch, for release builds use /MD. These
are set in the project's property pages under C/C++ --> Code
Generation --> Runtime Library. The problem the link above refers to
regarding NULL and class static variables has been fixed in VC7
(Visual Studio 2003) and thus should not be an issue for that
compiler.


On Sep 17, 12:16 pm, "Kenton Varda" <[EMAIL PROTECTED]> wrote:
> Ugh.  More evidence that libprotobuf should be statically-linked, not a DLL.
> Niall:  Maybe this explains your problem.  Can you try compiling static libs
> only and see if that fixes anything?
>
> On Tue, Sep 16, 2008 at 9:31 PM, mcdowella
> <[EMAIL PROTECTED]>wrote:
>
>
>
> > There are at least two problems with using STL and even ordinary code
> > across DLL boundaries with MSVC, both of which can be hard to get
> > round. One is that if you link statically (select the non-DLL version
> > of the run time libraries) the code inside the DLL will use a
> > different storage pool from code outside the DLL, so store allocated
> > on one side of the boundary and freed on the other side of the
> > boundary will break the storage pool that tries to free it. This will
> > also happen if the run time library selected by the code in the DLL is
> > not identical to that selected by the program using it. Another
> > problem is that much of the STL implementation selected by Microsoft
> > does not use 0 as a special pointer value to mark the ends of linked
> > lists and such things. It tends to allocate a little chunk of memory
> > and use that instead. These marker values are not exported across the
> > DLL boundary, so somebody reading an STL structure created on the
> > other side of the DLL boundary will not recognise the end list marker
> > and will fall of the end and start using rubbish pointers.
>
> > See
> >http://support.microsoft.com/kb/172396
> >http://support.microsoft.com/kb/168958
>
> >http://www.deez.info/sengelha/2006/03/03/c-stl-dlls-and-buggy-optimiz...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to