Protobuf does subclass hash_map and hash_set in order to "fix" the
interfaces to look like GCC's.  However, it does not use __declspec on these
definitions.

Can you create a minimal self-contained example program demonstrating the
problem?

On Fri, Dec 18, 2009 at 2:23 AM, Anu KR <anu.rajag...@gmail.com> wrote:

> Thanks every body for the reply.
>
> I did checked the project settings for protocol buffer libraries and
> our libraries, and they are the same. They were Multi-threaded Debug
> DLL (/MDd) for debug version and and Multi-threaded DLL (/MD) for
> release.
>
> However  we found that one of our classes were inheriting from
> std::set<int> and the same class was being imported as well using
> __declspec(dllimport) , So the compiler will generate the needed
> symbols for the stl related stuff . I suspect what is happening is the
> new version 2.2.0a of the protobuf is also doing similar thing and the
> same stl symols get generated in libprotbuf  as well. Now we have 2
> libraries importing the same stl related symols and that could be the
> reason for LNK2005 - already defined.
>
> What we did as a work around is changed the class which was importing
> the symbols to not inherit from std::set and the symbols are not
> getting generated any more in our library and it links fine.  Am not
> sure whether this is the best solution to do ?  We could do this since
> one of the  library which was having the issue was our own and was in
> our own control .
>
> What could be the possible solution if both of these libraries were 3pp. ?
>
> Thanks & Regards
> Anu K R
>
>
>
> On Thu, Dec 17, 2009 at 11:18 PM, Oleg Smolsky <oleg.smol...@gmail.com>
> wrote:
> > On Dec 17, 12:27 pm, Kenton Varda <ken...@google.com> wrote:
> >> On Thu, Dec 17, 2009 at 2:47 AM, <a...@sibmail.ru> wrote:
> >> > Hello,
> >>
> >> > You should use same runtime library setting to build your application
> and
> >> > protobuffer libraries.
> >>
> >> Specifically, debug vs. release, single-threaded vs. multi-threaded,
> etc.
> >>  Unfortunately, MSVC's STL implementation for each of these library
> >> implementations is different.
> > VS2008 does not have a single-threaded CRT any more, but configuring
> > debug/release and static/dynamic linking in a consistent way is vital.
> >
> > Oleg.
> >
> > --
> >
> > You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> > To post to this group, send email to proto...@googlegroups.com.
> > To unsubscribe from this group, send email to
> protobuf+unsubscr...@googlegroups.com<protobuf%2bunsubscr...@googlegroups.com>
> .
> > For more options, visit this group at
> http://groups.google.com/group/protobuf?hl=en.
> >
> >
> >
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To post to this group, send email to proto...@googlegroups.com.
> To unsubscribe from this group, send email to
> protobuf+unsubscr...@googlegroups.com<protobuf%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/protobuf?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to proto...@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.


Reply via email to