I ran into similar compile errors, most of which were because the VxWorks 
compiler we are using does not support TR1 very well, including hash maps.  
To get around these issues I recommend using Boost.  In the config.h file 
you can switch out using the stl hash_map/hash_set for the Boost version. 
  Something like:

#define HASH_MAP_H <boost/unordered_map.hpp>

#define HASH_NAMESPACE boost

#define HASH_SET_H <boost/unordered_set.hpp>

Of course you will need to add Boost to the include path.

On Monday, March 12, 2012 10:28:08 PM UTC-4, Rob wrote:
>
> Hi everyone. 
>
> I'm currently having issues cross compiling protobuf (2.4.1) so it 
> will work with vxworks. 
>
> This is how I configure protobuf with cygwin: 
> CC=ccppc \ 
> CXX=g++ppc \ 
> CFLAGS="-mcpu=604 -mstrict-align -fno-implicit-fp -ansi -g -fno- 
> builtin -Wall  -IC:/WindRiver/vxworks-6.7/target/h -IC:/WindRiver/ 
> vxworks-6.7/target/h/wrn/coreip   -I../Infrastructure -DCPU=PPC604 - 
> DTOOL_FAMILY=gnu -DTOOL=gnu -D_WRS_KERNEL  -DINET  -D_WRS_LIB_BUILD 
> -D_VSB_CONFIG_FILE=\"C:/WindRiver/vxworks-6.7/target/lib/h/config/ 
> vsbConfig.h\"    -MD" \ 
> CXXFLAGS="$CFLAGS" \ 
> ./configure --host=ppc --with-protoc=$HOME/install/bin/protoc -prefix= 
> $HOME/install-ppc 
>
> $ ccppc.exe --version   (this is the cross compiler) 
> ccppc.exe (Wind River VxWorks G++ DWARF-EH 4.1-131) 4.1.2 
>
> And make fails with this mess.  I don't know how to make it work... 
> any help? 
>
> /bin/sh ../libtool  --tag=CXX   --mode=compile g++ppc -DHAVE_CONFIG_H - 
> I. -I..     -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign- 
> compare  -mcpu=604 -mstrict-align -fno-implicit-fp -ansi -g -fno- 
> builtin -Wall  -IC:/WindRiver/vxworks-6.7/target/h -IC:/WindRiver/ 
> vxworks-6.7/target/h/wrn/coreip   -I../Infrastructure -DCPU=PPC604 - 
> DTOOL_FAMILY=gnu -DTOOL=gnu -D_WRS_KERNEL  -DINET  -D_WRS_LIB_BUILD 
> -D_VSB_CONFIG_FILE="C:/WindRiver/vxworks-6.7/target/lib/h/config/ 
> vsbConfig.h"    -MD -MT extension_set.lo -MD -MP -MF .deps/ 
> extension_set.Tpo -c -o extension_set.lo `test -f 'google/protobuf/ 
> extension_set.cc' || echo './'`google/protobuf/extension_set.cc 
> libtool: compile:  g++ppc -DHAVE_CONFIG_H -I. -I.. -Wall -Wwrite- 
> strings -Woverloaded-virtual -Wno-sign-compare -mcpu=604 -mstrict- 
> align -fno-implicit-fp -ansi -g -fno-builtin -Wall -IC:/WindRiver/ 
> vxworks-6.7/target/h -IC:/WindRiver/vxworks-6.7/target/h/wrn/coreip - 
> I../Infrastructure -DCPU=PPC604 -DTOOL_FAMILY=gnu -DTOOL=gnu - 
> D_WRS_KERNEL -DINET -D_WRS_LIB_BUILD -D_VSB_CONFIG_FILE=C:/WindRiver/ 
> vxworks-6.7/target/lib/h/config/vsbConfig.h -MD -MT extension_set.lo - 
> MD -MP -MF .deps/extension_set.Tpo -c google/protobuf/extension_set.cc 
> -o extension_set.o 
> c:/windriver/gnu/4.1.2-vxworks-6.7/lib/gcc/../../include/c++/4.1/ 
> hash_map: In instantiation of 'std::_Hmap_traits<std::pair<const 
> google::protobuf::MessageLite*, int>, 
> google::protobuf::internal::ExtensionInfo, 
> google::protobuf::hash<std::pair<const google::protobuf::MessageLite*, 
> int> >, std::equal_to<std::pair<const google::protobuf::MessageLite*, 
> int> >, false>': 
> c:/windriver/gnu/4.1.2-vxworks-6.7/lib/gcc/../../include/c++/4.1/xhash: 
> 195:   instantiated from 'std::_Hash<std::_Hmap_traits<std::pair<const 
> google::protobuf::MessageLite*, int>, 
> google::protobuf::internal::ExtensionInfo, 
> google::protobuf::hash<std::pair<const google::protobuf::MessageLite*, 
> int> >, std::equal_to<std::pair<const google::protobuf::MessageLite*, 
> int> >, false> >' 
> c:/windriver/gnu/4.1.2-vxworks-6.7/lib/gcc/../../include/c++/4.1/ 
> hash_map:78:   instantiated from 'std::hash_map<std::pair<const 
> google::protobuf::MessageLite*, int>, 
> google::protobuf::internal::ExtensionInfo, 
> google::protobuf::hash<std::pair<const google::protobuf::MessageLite*, 
> int> >, std::equal_to<std::pair<const google::protobuf::MessageLite*, 
> int> > >' 
> ./google/protobuf/stubs/hash.h:165:   instantiated from 
> 'google::protobuf::hash_map<std::pair<const 
> google::protobuf::MessageLite*, int>, 
> google::protobuf::internal::ExtensionInfo, 
> google::protobuf::hash<std::pair<const google::protobuf::MessageLite*, 
> int> >, std::equal_to<std::pair<const google::protobuf::MessageLite*, 
> int> > >' 
> google/protobuf/extension_set.cc:68:   instantiated from here 
> c:/windriver/gnu/4.1.2-vxworks-6.7/lib/gcc/../../include/c++/4.1/ 
> hash_map:21: error: no class template named 'rebind' in 'struct 
> std::equal_to<std::pair<const google::protobuf::MessageLite*, int> >' 
> c:/windriver/gnu/4.1.2-vxworks-6.7/lib/gcc/../../include/c++/4.1/ 
> hash_map:24: error: no class template named 'rebind' in 'struct 
> std::equal_to<std::pair<const google::protobuf::MessageLite*, int> >' 
> c:/windriver/gnu/4.1.2-vxworks-6.7/lib/gcc/../../include/c++/4.1/ 
> hash_map:25: error: no class template named 'rebind' in 'struct 
> std::equal_to<std::pair<const google::protobuf::MessageLite*, int> >' 
> google/protobuf/extension_set.cc: In function 'const 
> google::protobuf::internal::ExtensionInfo* 
> google::protobuf::internal::<unnamed>::FindRegisteredExtension(const 
> google::protobuf::MessageLite*, int)': 
> google/protobuf/extension_set.cc:94: error: no matching function for 
> call to 'FindOrNull(google::protobuf::hash_map<std::pair<const 
> google::protobuf::MessageLite*, int>, 
> google::protobuf::internal::ExtensionInfo, 
> google::protobuf::hash<std::pair<const google::protobuf::MessageLite*, 
> int> >, std::equal_to<std::pair<const google::protobuf::MessageLite*, 
> int> > >&, std::pair<const google::protobuf::MessageLite*, int>)' 
> make[3]: *** [extension_set.lo] Error 1 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/protobuf/-/tM-Yb5XvcRsJ.
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