Compilation issue on Solaris 9 with CC version 5.9

76 views
Skip to first unread message

vikram

unread,
Nov 9, 2009, 10:27:00 PM11/9/09
to Protocol Buffers

Hello Guys,

I have generated protocol buffer header files and source files
from proto and compiled those with include files on linux without any
issues. Here I am trying to use same source files with same include
directory but on solaris so I have encountered following problems.
Does anyone have same issues while working with protobuf 2.1.0

(*)() in call to pthread_once(_once*, extern "C" void(*)()) is being
passed void(*)().
"/work/$$$$/SunBuild/Server/../Tools/protobuf/include/google/protobuf/
descriptor.h", line 324: Warning: Identifier expected instead of "}".
"/work/$$$$/SunBuild/Server/../Tools/protobuf/include/google/protobuf/
descriptor.h", line 343: Warning: Identifier expected instead of "}".
"/work//$$$$//SunBuild/Server/../Tools/protobuf/include/google/
protobuf/descriptor.h", line 354: Warning: Identifier expected instead
of "}".
"/work//$$$$//SunBuild/Server/../Tools/protobuf/include/google/
protobuf/wire_format.h", line 177: Warning: Identifier expected
instead of "}".
"/work//$$$$//SunBuild/Server/../Tools/protobuf/include/google/
protobuf/descriptor.pb.h", line 83: Error: Unexpected type name
"google::protobuf::FieldDescriptorProto_Type" encountered.
"/work//$$$$//SunBuild/Server/../Tools/protobuf/include/google/
protobuf/descriptor.pb.h", line 102: Error: Unexpected type name
"google::protobuf::FieldDescriptorProto_Label" encountered.
"/work//$$$$//SunBuild/Server/../Tools/protobuf/include/google/
protobuf/descriptor.pb.h", line 120: Error: Unexpected type name
"google::protobuf::FileOptions_OptimizeMode" encountered.
"/work//$$$$//SunBuild/Server/../Tools/protobuf/include/google/
protobuf/descriptor.pb.h", line 138: Error: Unexpected type name
"google::protobuf::FieldOptions_CType" encountered.
4 Error(s) and 5 Warning(s) detected.

Thanks & Regards,
Vikram

Kenton Varda

unread,
Nov 11, 2009, 5:18:39 PM11/11/09
to vikram, Protocol Buffers
The warnings look harmless (it's complaining about the trailing comma after the last value in an enum).

The errors suggest that your compiler is not very good with templates.  The line of code is:

  return ::google::protobuf::internal::ParseNamedEnum<FieldDescriptorProto_Type>(

Apparently your compiler doesn't recognize that ParseNamedEnum is a template.  What compiler are you using?

Monty Taylor

unread,
Nov 11, 2009, 5:55:02 PM11/11/09
to Kenton Varda, vikram, Protocol Buffers
I use 2.1.0 on solaris with sun studio compiler all the time. The thing is, you cannot use Cstd, you must use stlport4. I already have the protobuf configure script injecting the CXXFLAGS for that, but if you are overriding them, it's gonna get ugly. Grep through the m4 files for stlport4 and you should see what they are (I'm on a plane else I would paste the flags you need)

If there is another issue here, I'll be interested to hear about it. If that doesn't fix it, could you show the entire compiler invocation line?

"Kenton Varda" <ken...@google.com> wrote:

Sent from my Android phone with K-9. Please excuse my brevity.

sidea

unread,
Sep 29, 2014, 6:07:48 AM9/29/14
to prot...@googlegroups.com, ken...@google.com, patil...@gmail.com, mor...@inaugust.com
Re-opening a very old thread here!

I am trying to build protocol buffers 2.3.0 on solaris using CC: Sun C++ 5.7 2005/03/01.

The configure command I have used is:

./configure --prefix=/usr/local/protobuf-2.2.0 --without-zlib --disable-64bit-solaris CFLAGS=-m32 PROTOBUF_OPT_FLAG=-O3 CXXFLAGS="-m32 -g -DNDEBUG -fno-exceptions -library=stlport4 -xlibmil -xdepend -xbuiltin -mt -compat=5 -library=Crun -template=no%extdef" LDFLAGS=-m32


I get a fair way through on the compilation but then get the unexpected type errors as above, even though I am using stlport4 - my error output is:

libtool: compile:  CC -DHAVE_CONFIG_H -I. -I.. -D_REENTRANT -O3 -m32 -g -DNDEBUG -fno-exceptions -library=stlport4 -xlibmil -xdepend -xbuiltin -mt -compat=5 -library=Crun -template=no%extdef -c google/protobuf/descriptor.cc 
CC: Warning: Option -m32 passed to ld, if ld is invoked, ignored otherwise
CC: Warning: Option -fno-exceptions passed to ld, if ld is invoked, ignored otherwise
"./google/protobuf/descriptor.h", line 324: Warning: Identifier expected instead of "}".
"./google/protobuf/descriptor.h", line 343: Warning: Identifier expected instead of "}".
"./google/protobuf/descriptor.h", line 354: Warning: Identifier expected instead of "}".
"./google/protobuf/descriptor.pb.h", line 87: Error: Unexpected type name "google::protobuf::FieldDescriptorProto_Type" encountered.
"./google/protobuf/descriptor.pb.h", line 107: Error: Unexpected type name "google::protobuf::FieldDescriptorProto_Label" encountered.
"./google/protobuf/descriptor.pb.h", line 127: Error: Unexpected type name "google::protobuf::FileOptions_OptimizeMode" encountered.
"./google/protobuf/descriptor.pb.h", line 147: Error: Unexpected type name "google::protobuf::FieldOptions_CType" encountered.
"./google/protobuf/wire_format_lite.h", line 95: Warning: Identifier expected instead of "}".
"./google/protobuf/wire_format_lite.h", line 118: Warning: Identifier expected instead of "}".
"./google/protobuf/wire_format_lite.h", line 133: Warning: Identifier expected instead of "}".
"./google/protobuf/wire_format.h", line 227: Warning: Identifier expected instead of "}".
"./google/protobuf/stubs/once.h", line 115: Warning (Anachronism): Formal argument 2 of type extern "C" void(*)() in call to pthread_once(_once*, extern "C" void(*)()) is being passed void(*)().
4 Error(s) and 8 Warning(s) detected.
*** Error code 1
make: Fatal error: Command failed for target `descriptor.lo'


Can anyone offer any ideas on what I need to do to get this sorted out?

Thanks.
Reply all
Reply to author
Forward
0 new messages