That must have been the problem. This time, I started over and only
used 2008, everything worked fine.

On Apr 8, 5:07 pm, Kenton Varda <ken...@google.com> wrote:
> I don't think a libprotobuf compiled with VS2008 will work correctly with a
> project compiled in VS2003.  Microsoft has a tendency to change the layout
> of their STL objects frequently (even debug vs. release versions of the
> standard library have different STL layouts), and libprotobuf uses STL
> extensively in its interface.  You will probably see weird crashes if you
> can get it to compile at all.
>
> On Wed, Apr 8, 2009 at 3:02 PM, <scotty2...@gmail.com> wrote:
>
> > Well, now I'm convinced my problem was directly related to visual
> > studio. I originally started this project in VS2003 so I wouldn't have
> > to cart around a bunch of vc90 dlls. However, I build libprotobuf in
> > vs 2008. That threw me off at one point, I thought my problems were
> > related to the version difference, so I opened my test project in
> > vs2008, and my solution/project files were upgraded to 2008. I still
> > had the same linking errors and came here. After you confirmed I
> > should link directly to the .lib file, I started over. I created a
> > fresh project and meticulously added files and built after each file.
> > By the time I was finished adding files, I still didn't have any
> > linker errors. I don't know what the problem was, but it's working
> > now.
>
> > On Apr 8, 4:10 pm, Kenton Varda <ken...@google.com> wrote:
> > > On Wed, Apr 8, 2009 at 2:01 PM, <scotty2...@gmail.com> wrote:
>
> > > > I don't know how else to link to libprotobuf.lib. Here's the resulting
> > > > command lines of the options I've tried:
>
> > > > /LIBPATH :"C:\Development\Libraries\lib" contains the output of the
> > > > files built using the project files in vsprojects folder included in
> > > > the protobuf source.
>
> > > > First, I'm not speciyfing libprotobuf.lib, but including the libpath
> > > > containing libprotobuf.lib (I think this is the way I'm supposed to
> > > > link it):
>
> > > No, you have to explicitly specify libprotobuf.lib.  The compiler will
> > not
> > > automatically try to link everything in the directory.
>
> > > Sorry, I'm not very familiar with MSVC so I'm not sure exactly what you
> > have
> > > to do, but you *do* have to explicitly specify libprotobuf.lib.
>
> > > > /OUT:"Release/backupcomm.exe" /NOLOGO /LIBPATH:"C:\Development
> > > > \Libraries\lib" /LIBPATH:"C:\Program Files\Microsoft Platform SDK
> > > > \Lib" /MANIFEST /MANIFESTFILE:"Release
> > > > \backupcomm.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker'
> > > > uiAccess='false'" /DEBUG /PDB:"c:\Development\Projects\BackupDirector
> > > > \v2\backupcomm\backupcomm\Release\backupcomm.pdb" /SUBSYSTEM:CONSOLE /
> > > > OPT:REF /OPT:ICF /DYNAMICBASE:NO /MACHINE:X86 /ERRORREPORT:PROMPT
> > > > ws2_32.lib wsock32.lib  kernel32.lib user32.lib gdi32.lib winspool.lib
> > > > comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib
> > > > odbc32.lib odbccp32.lib
>
> > > > Explicitly specifying libprotobuf.lib as well:
>
> > > > /OUT:"Release/backupcomm.exe" /NOLOGO /LIBPATH:"C:\Development
> > > > \Libraries\lib" /LIBPATH:"C:\Program Files\Microsoft Platform SDK
> > > > \Lib" /MANIFEST /MANIFESTFILE:"Release
> > > > \backupcomm.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker'
> > > > uiAccess='false'" /DEBUG /PDB:"c:\Development\Projects\BackupDirector
> > > > \v2\backupcomm\backupcomm\Release\backupcomm.pdb" /SUBSYSTEM:CONSOLE /
> > > > OPT:REF /OPT:ICF /DYNAMICBASE:NO /MACHINE:X86 /ERRORREPORT:PROMPT
> > > > ws2_32.lib wsock32.lib c:\development\libraries\lib\libprotobuf.lib
> > > > kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib
> > > > advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib
> > > > odbccp32.lib
>
> > > > On Apr 8, 1:09 pm, Kenton Varda <ken...@google.com> wrote:
> > > > > It appears you are not linking against libprotobuf.lib.
>
> > > > > On Wed, Apr 8, 2009 at 8:28 AM, <scotty2...@gmail.com> wrote:
>
> > > > > > I think part of my problem was using precompiled headers in the
> > > > > > project. I've removed that option and recreated my project, but I
> > > > > > still get these linker errors:
>
> > > > > > backupcomm error LNK2019: unresolved external symbol "public:
> > static
> > > > > > class google::protobuf::MessageFactory * __cdecl
> > > > > > google::protobuf::MessageFactory::generated_factory(void)" (?
> > > > > > generated_fact...@messagefactory@proto...@google@@sapav...@xz)
> > > > > > referenced in function "public: __thiscall
> > backupcomm::Actions::Actions
> > > > > > (void)" (??0acti...@backupcomm@@q...@xz)
> > > > > > backupcomm error LNK2019: unresolved external symbol "public:
> > static
> > > > > > void __cdecl
> > > > > > google::protobuf::MessageFactory::InternalRegisterGeneratedMessage
> > > > > > (class google::protobuf::Descriptor const *,class
> > > > > > google::protobuf::Message const *)" (?
> > > > > > internalregistergeneratedmess...@messagefactory@proto...@google
> > > > > > @@saxpbvdescrip...@23@pbvmess...@23@@Z)
> > > > > > referenced in function "void __cdecl
> > > > > > backupcomm::protobuf_BuildDesc_def_2eproto_AssignGlobalDescriptors
> > > > > > (class google::protobuf::FileDescriptor const *)" (?
> > > > > > protobuf_builddesc_def_2eproto_assignglobaldescript...@backupcomm
> > > > > > @@yaxpbvfiledescrip...@protobuf@google@@@Z)
> > > > > > backupcomm error LNK2019: unresolved external symbol "public:
> > > > > > __thiscall
>
> > google::protobuf::internal::GeneratedMessageReflection::GeneratedMessageReflection
> > > > > > (class google::protobuf::Descriptor const *,class
> > > > > > google::protobuf::Message const *,int const *
> > const,int,int,int,class
> > > > > > google::protobuf::DescriptorPool const *,int)" (??
> > > > > > 0generatedmessagereflect...@internal@proto...@google
> > > > @@q...@pbvdescriptor
> > > > > > @2...@pbvmessage@2...@qbhhhhpbvdescriptorpool@2...@h@Z)
> > > > > > referenced in function "void __cdecl
> > > > > > backupcomm::protobuf_BuildDesc_def_2eproto_AssignGlobalDescriptors
> > > > > > (class google::protobuf::FileDescriptor const *)" (?
> > > > > > protobuf_builddesc_def_2eproto_assignglobaldescript...@backupcomm
> > > > > > @@yaxpbvfiledescrip...@protobuf@google@@@Z)
> > > > > > backupcomm error LNK2019: unresolved external symbol "public:
> > static
> > > > > > class google::protobuf::DescriptorPool const * __cdecl
> > > > > > google::protobuf::DescriptorPool::generated_pool(void)" (?
> > > > > > generated_p...@descriptorpool@proto...@google@@sapbv...@xz)
> > referenced
> > > > > > in function "void __cdecl
> > > > > > backupcomm::protobuf_BuildDesc_def_2eproto_AssignGlobalDescriptors
> > > > > > (class google::protobuf::FileDescriptor const *)" (?
> > > > > > protobuf_builddesc_def_2eproto_assignglobaldescript...@backupcomm
> > > > > > @@yaxpbvfiledescrip...@protobuf@google@@@Z)
> > > > > > backupcomm error LNK2019: unresolved external symbol "public: class
> > > > > > google::protobuf::FileDescriptor const * __thiscall
> > > > > > google::protobuf::DescriptorPool::InternalBuildGeneratedFile(void
> > > > > > const *,int,void (__cdecl*)(class google::protobuf::FileDescriptor
> > > > > > const *))" (?
> > > > > > internalbuildgeneratedf...@descriptorpool@proto...@google
> > > > > > @@qaepbvfiledescrip...@23@PBXHP6AXPBV423@@z...@z)
> > > > > > referenced in function "void __cdecl
> > > > > > backupcomm::protobuf_BuildDesc_def_2eproto(void)" (?
> > > > > > protobuf_builddesc_def_2epr...@backupcomm@@YAXXZ)
> > > > > > backupcomm error LNK2019: unresolved external symbol "public:
> > static
> > > > > > class google::protobuf::DescriptorPool * __cdecl
> > > > > > google::protobuf::DescriptorPool::internal_generated_pool(void)" (?
> > > > > > internal_generated_p...@descriptorpool@proto...@google
> > @@sapav...@xz)
> > > > > > referenced in function "void __cdecl
> > > > > > backupcomm::protobuf_BuildDesc_def_2eproto(void)" (?
> > > > > > protobuf_builddesc_def_2epr...@backupcomm@@YAXXZ)
> > > > > > backupcomm error LNK2019: unresolved external symbol "void __cdecl
> > > > > > google::protobuf::internal::VerifyVersion(int,int,char const *)" (?
> > > > > > verifyvers...@internal@proto...@google@@yaxhh...@z) referenced in
> > > > > > function "void __cdecl backupcomm::protobuf_BuildDesc_def_2eproto
> > > > > > (void)" (?protobuf_builddesc_def_2epr...@backupcomm@@YAXXZ)
> > > > > > backupcomm error LNK2001: unresolved external symbol "public:
> > virtual
> > > > > > bool __thiscall google::protobuf::Message::SerializeWithCachedSizes
> > > > > > (class google::protobuf::io::CodedOutputStream *)const " (?
> > > > > > serializewithcachedsi...@message@proto...@google
> > > > > > @@ube_npavcodedoutputstr...@io@23@@Z)
> > > > > > backupcomm error LNK2001: unresolved external symbol "public:
> > virtual
> > > > > > int __thiscall google::protobuf::Message::SpaceUsed(void)const " (?
> > > > > > spaceu...@message@proto...@google@@UBEHXZ)
> > > > > > backupcomm error LNK2001: unresolved external symbol "public:
> > virtual
> > > > > > int __thiscall google::protobuf::Message::ByteSize(void)const " (?
> > > > > > bytes...@message@proto...@google@@UBEHXZ)
> > > > > > backupcomm error LNK2001: unresolved external symbol "public:
> > virtual
> > > > > > bool __thiscall
> > google::protobuf::Message::MergePartialFromCodedStream
> > > > > > (class google::protobuf::io::CodedInputStream *)" (?
> > > > > > mergepartialfromcodedstr...@message@proto...@google
> > > > > > @@uae_npavcodedinputstr...@io@23@@Z)
> > > > > > backupcomm error LNK2001: unresolved external symbol "public:
> > virtual
> > > > > > void __thiscall google::protobuf::Message::DiscardUnknownFields
> > > > > > (void)" (?discardunknownfie...@message@proto...@google@@UAEXXZ)
> > > > > > backupcomm error LNK2001: unresolved external symbol "public:
> > virtual
> > > > > > bool __thiscall google::protobuf::Message::IsInitialized(void)const
> > > > > > " (?isinitiali...@message@proto...@google@@UBE_NXZ)
> > > > > > backupcomm error LNK2001: unresolved external symbol "public:
> > virtual
> > > > > > void __thiscall google::protobuf::Message::Clear(void)" (?
>
> ...
>
> read more »
--~--~---------~--~----~------------~-------~--~----~
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 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to