I compiled protobuf with nmake in my win7 machine, using VS 12.0 tool chain and nmake check show the result pass all the tests. I compiled with -Dprotobuf_BUILD_SHARED_LIBS=ON. Everything seems fine, while, when I use libprotobuf.lib and libprotobuf.dll in my own project (configured with Release Win32 platform), it just prompt linking errors, I have added #define PROTOBUF_USE_DLLS in code. I have really been working on this issue for long time, still have no clues. Any message is really appreciate, thanks!
========Full Error Message Below ================ Error 11 error LNK2001: unresolved external symbol "int google::protobuf::internal::empty_string_once_init_" (?empty_string_once_init_@internal@protobuf@google@@3HA) C:\hydra\CatsTradeMktUpdt\CatsMktUpdt\ProtoBufMsg.pb.obj CatsMktUpdt Error 12 error LNK2001: unresolved external symbol "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const * const google::protobuf::internal::empty_string_" (?empty_string_@internal@protobuf@google@@3PBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@B) C:\hydra\CatsTradeMktUpdt\CatsMktUpdt\ProtoBufMsg.pb.obj CatsMktUpdt Error 13 error LNK1120: 2 unresolved externals C:\hydra\CatsTradeMktUpdt\Release_bin\CatsMktUpdt.exe CatsMktUpdt ========Full Warning Message Below ================== Warning 3 warning C4251: 'google::protobuf::internal::LogMessage::message_' : class 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>' needs to have dll-interface to be used by clients of class 'google::protobuf::internal::LogMessage' C:\hydra\CatsTradeMktUpdt\include\google\protobuf\stubs\logging.h 100 1 CatsMktUpdt Warning 4 warning C4251: 'google::protobuf::Arena::lifecycle_id_generator_' : class 'google::protobuf::internal::SequenceNumber' needs to have dll-interface to be used by clients of class 'google::protobuf::Arena' C:\hydra\CatsTradeMktUpdt\include\google\protobuf\arena.h 545 1 CatsMktUpdt Warning 5 warning C4251: 'google::protobuf::Arena::options_' : struct 'google::protobuf::ArenaOptions' needs to have dll-interface to be used by clients of class 'google::protobuf::Arena' C:\hydra\CatsTradeMktUpdt\include\google\protobuf\arena.h 904 1 CatsMktUpdt Warning 6 warning C4251: 'google::protobuf::DescriptorPool::tables_' : class 'google::protobuf::internal::scoped_ptr<google::protobuf::DescriptorPool::Tables>' needs to have dll-interface to be used by clients of class 'google::protobuf::DescriptorPool' C:\hydra\CatsTradeMktUpdt\include\google\protobuf\descriptor.h 1594 1 CatsMktUpdt Warning 7 warning C4251: 'google::protobuf::DescriptorPool::unused_import_track_files_' : class 'std::set<std::string,std::less<_Kty>,std::allocator<_Ty>>' needs to have dll-interface to be used by clients of class 'google::protobuf::DescriptorPool' C:\hydra\CatsTradeMktUpdt\include\google\protobuf\descriptor.h 1599 1 CatsMktUpdt Warning 8 warning C4251: 'google::protobuf::internal::ExtensionSet::extensions_' : class 'std::map<int,google::protobuf::internal::ExtensionSet::Extension,std::less<_Kty>,std::allocator<std::pair<const _Kty,_Ty>>>' needs to have dll-interface to be used by clients of class 'google::protobuf::internal::ExtensionSet' C:\hydra\CatsTradeMktUpdt\include\google\protobuf\extension_set.h 611 1 CatsMktUpdt -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscr...@googlegroups.com. To post to this group, send email to protobuf@googlegroups.com. Visit this group at https://groups.google.com/group/protobuf. For more options, visit https://groups.google.com/d/optout.