Hmm... I tried loading in the latest version of googletest's code. I'm not familiar with how to update gtest's VS project files to use C runtime library versions matching those protobuf... could you let me know how to do this? Without any project file modifications, I get fewer compiler errors, but get many warnings. Here are the first few warnings that I get:
... 1> message.cc 2>C:\Program Files\MSBuild\Microsoft.Cpp \v4.0\Microsoft.CppBuild.targets(1151,5): warning MSB8012: TargetPath(C:\Users\Karthik\Documents\Visual Studio 2010\Projects \ProtocolBuffers\gtest\msvc\protobuf/Debug\gtest.lib) does not match the Library's OutputFile property value (C:\Users\Karthik\Documents \Visual Studio 2010\Projects\ProtocolBuffers\gtest\msvc\protobuf\Debug \gtestd.lib). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $ (TargetExt) property values match the value specified in % (Lib.OutputFile). 2>C:\Program Files\MSBuild\Microsoft.Cpp \v4.0\Microsoft.CppBuild.targets(1153,5): warning MSB8012: TargetName(gtest) does not match the Library's OutputFile property value (gtestd). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $ (TargetExt) property values match the value specified in % (Lib.OutputFile). ... 1> coded_stream.cc 1> Generating Code... 1>hash.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library 1> libprotobuf.vcxproj -> C:\Users\Karthik\Documents\Visual Studio 2010\Projects\ProtocolBuffers\vsprojects\Debug\libprotobuf.lib 1>FinalizeBuildStatus: 1> Deleting file "Debug\libprotobuf.unsuccessfulbuild". 1> Touching "Debug\libprotobuf.lastbuildstate". ... In particular, libprotobuf.lib and libprotoc.lib produce many warnings, such as the following: 7>main.obj : warning LNK4099: PDB 'vc100.pdb' was not found with 'main.obj' or at 'C:\Users\Karthik\Documents\Visual Studio 2010\Projects\ProtocolBuffers\vsprojects\Debug\vc100.pdb'; linking object as if no debug info 7>libprotobuf.lib(coded_stream.obj) : warning LNK4099: PDB 'vc100.pdb' was not found with 'libprotobuf.lib(coded_stream.obj)' or at 'C:\Users \Karthik\Documents\Visual Studio 2010\Projects\ProtocolBuffers \vsprojects\Debug\vc100.pdb'; linking object as if no debug info 7>libprotobuf.lib(common.obj) : warning LNK4099: PDB 'vc100.pdb' was not found with 'libprotobuf.lib(common.obj)' or at 'C:\Users\Karthik \Documents\Visual Studio 2010\Projects\ProtocolBuffers\vsprojects\Debug \vc100.pdb'; linking object as if no debug info ... 7>libprotoc.lib(code_generator.obj) : warning LNK4099: PDB 'vc100.pdb' was not found with 'libprotoc.lib(code_generator.obj)' or at 'C:\Users \Karthik\Documents\Visual Studio 2010\Projects\ProtocolBuffers \vsprojects\Debug\vc100.pdb'; linking object as if no debug info 7>libprotoc.lib(command_line_interface.obj) : warning LNK4099: PDB 'vc100.pdb' was not found with 'libprotoc.lib(command_line_interface.obj)' or at 'C:\Users\Karthik \Documents\Visual Studio 2010\Projects\ProtocolBuffers\vsprojects\Debug \vc100.pdb'; linking object as if no debug info 7>libprotoc.lib(subprocess.obj) : warning LNK4099: PDB 'vc100.pdb' was not found with 'libprotoc.lib(subprocess.obj)' or at 'C:\Users\Karthik \Documents\Visual Studio 2010\Projects\ProtocolBuffers\vsprojects\Debug \vc100.pdb'; linking object as if no debug info ... I also get several linking errors, such as the following: 6>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: __thiscall std::_Container_base12::~_Container_base12(void)" (?? 1_container_bas...@std@@q...@xz) already defined in gtestd.lib(gtest.obj) 6>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: __thiscall std::_Container_base12::_Container_base12(void)" (?? 0_container_bas...@std@@q...@xz) already defined in gtestd.lib(gtest.obj) 6>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: void __thiscall std::_Container_base12::_Orphan_all(void)" (? _orphan_...@_container_base12@std@@QAEXXZ) already defined in gtestd.lib(gtest.obj) ... 6>LIBCMTD.lib(_file.obj) : error LNK2005: ___iob_func already defined in MSVCRTD.lib(MSVCR100D.dll) 6>LIBCMTD.lib(setlocal.obj) : error LNK2005: __configthreadlocale already defined in MSVCRTD.lib(MSVCR100D.dll) 6>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __free_dbg already defined in MSVCRTD.lib(MSVCR100D.dll) There is also a syntax error: 9> cpp_unittest.cc 9>c:\users\karthik\documents\visual studio 2010\projects \protocolbuffers\src\google\protobuf\compiler\cpp \cpp_unittest.cc(812): error C2059: syntax error : 'nullptr' Thanks very much for your help. Regards, Karthik On May 26, 7:36 pm, Kenton Varda <ken...@google.com> wrote: > Looks like an error in gtest, which is a separate project. If they have > fixed it and released a new version before the next protobuf release, then > we will pick up that fix. In the meantime, you could try downloading the > fixed gtest release and dropping it into the "gtest" directory under the > protobuf source tree, but you may have to update gtest's VS project files to > use C runtime library versions matching the protobuf VS projects (last I > checked they didn't match; the protobuf release contains modified project > files for gtest). > > > > On Mon, May 24, 2010 at 10:42 AM, Karth <karthik.naraya...@gmail.com> wrote: > > Hello, > > > When I try to compile the solution found in vsprojects under Visual > > Studio 2010, I get multiple errors, the first of which is: > > > Visual Studio 2010\Projects\protobuf-2.3.0\gtest\include\gtest/ > > internal/gtest-tuple.h(745): error C3855: 'std::tr1::tuple_element': > > template parameter '_Idx' is incompatible with the declaration > > > Following errors include, but aren't limited to: > > > 2>ClCompile: > > 2> gtest-death-test.cc > > Visual Studio 2010\Projects\protobuf-2.3.0\gtest\include\gtest/ > > internal/gtest-tuple.h(757): error C2039: 'type' : is not a member of > > 'std::tr1::tuple_element' > > Visual Studio 2010\Projects\protobuf-2.3.0\gtest\include\gtest/ > > internal/gtest-tuple.h(742) : see declaration of > > 'std::tr1::tuple_element' > > Visual Studio 2010\Projects\protobuf-2.3.0\gtest\include\gtest/ > > internal/gtest-tuple.h(757): error C2146: syntax error : missing ',' > > before identifier 'type' > > > While some files seen to be compiling without errors, other files > > don't compile (such as the one mentioned above). Are there any > > settings should have set within VS 2010 that I missed? > > > Regards, > > > Karthik > > > -- > > 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.c > > om> > > . > > 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.