Errors building Protobuf 3.5.1 with Visual Studio 2005

243 views
Skip to first unread message

Eric Pederson

unread,
May 29, 2018, 12:42:54 PM5/29/18
to Protocol Buffers
Hi all:

I am trying to build Protobuf (3.5.1) using Visual Studio 2005 (I know, it's ancient, but we are stuck with it for now).  I am getting these errors:


Compiling...
main.cc
src\google/protobuf/stubs/hash.h(309) : error C2977: 'stdext::hash_map' : too many template arguments
        C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include\hash_map(89) : see declaration of 'stdext::hash_map'
src\google/protobuf/stubs/hash.h(319) : see reference to class template instantiation 'google::protobuf::hash_map' being compiled
src\google/protobuf/stubs/hash.h(309) : error C2955: 'stdext::hash_map' : use of class template requires template argument list
        C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include\hash_map(89) : see declaration of 'stdext::hash_map'
src\google/protobuf/stubs/hash.h(311) : error C2977: 'stdext::hash_map' : too many template arguments
        C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include\hash_map(89) : see declaration of 'stdext::hash_map'

Is there a workaround for this?   Or is Protobuf 3 not compatible with VS 2005?   I am able to build Protobuf 2.6.1 with VS 2005.

Feng Xiao

unread,
May 29, 2018, 4:46:56 PM5/29/18
to eri...@gmail.com, Protocol Buffers
If you have to use vs2005, protobuf 2.6.1 might be the latest version you can use. From protobuf 3.0.0, we require at least vs 2008 to build.
 

--
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+u...@googlegroups.com.
To post to this group, send email to prot...@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Dennis Newbold

unread,
May 30, 2018, 3:00:03 AM5/30/18
to prot...@googlegroups.com
From the error messages, it appears that the problem may be due to hitting some internal compiler limits.  Just a wild thought, but you might try compiling just the protobuf code itself with vs 2008 or mingw gcc to create binary object files or perhaps a dll, and see if the result will link with the rest of your project, compiled with vs 2005.


On Tue, May 29, 2018 at 1:46 PM, 'Feng Xiao' via Protocol Buffers <prot...@googlegroups.com> wrote:
On Tue, May 29, 2018 at 9:42 AM Eric Pederson <eri...@gmail.com> wrote:
Hi all:

I am trying to build Protobuf (3.5.1) using Visual Studio 2005 (I know, it's ancient, but we are stuck with it for now).  I am getting these errors:


Compiling...
main.cc
src\google/protobuf/stubs/hash.h(309) : error C2977: 'stdext::hash_map' : too many template arguments
        C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include\hash_map(89) : see declaration of 'stdext::hash_map'
src\google/protobuf/stubs/hash.h(319) : see reference to class template instantiation 'google::protobuf::hash_map' being compiled
src\google/protobuf/stubs/hash.h(309) : error C2955: 'stdext::hash_map' : use of class template requires template argument list
        C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include\hash_map(89) : see declaration of 'stdext::hash_map'
src\google/protobuf/stubs/hash.h(311) : error C2977: 'stdext::hash_map' : too many template arguments
        C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include\hash_map(89) : see declaration of 'stdext::hash_map'

Is there a workaround for this?   Or is Protobuf 3 not compatible with VS 2005?   I am able to build Protobuf 2.6.1 with VS 2005.
If you have to use vs2005, protobuf 2.6.1 might be the latest version you can use. From protobuf 3.0.0, we require at least vs 2008 to build.

--
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+unsubscribe@googlegroups.com.

To post to this group, send email to prot...@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

--
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+unsubscribe@googlegroups.com.

To post to this group, send email to prot...@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.



--
   The way to be happy is to be good.
Reply all
Reply to author
Forward
0 new messages