I am having a lot of trouble compiling protobuf source code(2.4.1) for the .lib and .dlls. I followed google's intructions in the readme, word-for-word, but gtest has major errors. Although, I get the libprotobuf.lib, libprotobuf-lite.lib, and libprotoc.lib, does having gtest fail matter? Also, I can compile libprotobuf into a .dll but for libprotobuf-lite.dll, and libprotoc.dll the build fails with errors.
My question: How can I still use protobuf for programing in msvc++ 2010 express. Is there anyone else that implements it?
Thanks.
EDIT:: some build errors ...
1>------ Build started: Project: libprotobuf, Configuration: Debug Win32 ------
2>------ Build started: Project: gtest, Configuration: Debug Win32 ------
3>------ Build started: Project: libprotobuf-lite, Configuration: Debug Win32 ------
2> gtest.cc
3> zero_copy_stream_impl_lite.cc
1> zero_copy_stream_impl_lite.cc
2>c:\users\null\desktop\protobuf-2.4.1\protobuf-2.4.1\gtest\include\gtest\internal\gtest-tuple.h(745): error C3855: 'std::tr1::tuple_element': template parameter '_Idx' is incompatible with the declaration
2>c:\users\null\desktop\protobuf-2.4.1\protobuf-2.4.1\gtest\include\gtest\internal\gtest-tuple.h(757): error C2039: 'type' : is not a member of 'std::tr1::tuple_element'
2> c:\users\null\desktop\protobuf-2.4.1\protobuf-2.4.1\gtest\include\gtest\internal\gtest-tuple.h(742) : see declaration of 'std::tr1::tuple_element'
2>c:\users\null\desktop\protobuf-2.4.1\protobuf-2.4.1\gtest\include\gtest\internal\gtest-tuple.h(757): error C2146: syntax error : missing ',' before identifier 'type'
2>c:\users\null\desktop\protobuf-2.4.1\protobuf-2.4.1\gtest\include\gtest\internal\gtest-tuple.h(757): error C2065: 'type' : undeclared identifier
2>c:\users\null\desktop\protobuf-2.4.1\protobuf-2.4.1\gtest\include\gtest\internal\gtest-tuple.h(761): error C2039: 'type' : is not a member of 'std::tr1::tuple_element'
Well I can tell you what the problem is, if not the solution. One of the gtest headers is defining a class called std::tr1::tuple_element
. MS define a different class with exactly the same name, you can find it in the <utility> header file. I don't see any way to fix this other than to wait for google to do so. It is a problem that has been reported to them.
Alternatively you could download the pre-compiled Windows version