protobuf-c compilation errors

344 views
Skip to first unread message

zavi

unread,
Sep 29, 2009, 10:48:30 AM9/29/09
to Protocol Buffers
Hello,

I'm trying to compile protobuf-c and keep getting errors I didn't when
I tried compiling on other machines.
Obviously the preliminary protobuf compilation succeeded. I should
also mention that the previous successful installations were on a 64-
bit machine, where as the current machine I'm trying to install on is
32-bit.

I'm trying to install using a predefined prefix. The protobuf
installation was performed to the same target directory.

When I run:
./configure --prefix=<prefix dir>
I get this error -
checking google/protobuf/stubs/common.h usability... no
checking google/protobuf/stubs/common.h presence... no
checking for google/protobuf/stubs/common.h... no
configure: error:
ERROR: protobuf headers are required.
You must either install protobuf from google,
or if you have it installed in a custom location
you must add '-Iincludedir' to CXXFLAGS
and '-Llibdir' to LDFLAGS.

So I tried running this instead:
./configure CXXFLAGS=-I<prefix dir>/include LDFLAGS=-L=<prefix dir>/
lib --prefix==<prefix dir>

The operation succeeds although with an alarming warning:
configure: WARNING: google/protobuf/stubs/common.h: accepted by the
compiler, rejected by the preprocessor!
configure: WARNING: google/protobuf/stubs/common.h: proceeding with
the compiler's result

When I try to run make now I fail on this error:
make[2]: Entering directory `<install dir>/new_installs/protobuf-
c-0.11/src/test'
/bin/sh ../../libtool --tag=CXX --mode=link g++ -I<prefix dir>/
include -L<prefix dir>/lib -o cxx-generate-packed-data cxx-generate-
packed-data.o test-full.pb.o -lprotobuf
g++ -I<prefix dir>/include -o cxx-generate-packed-data cxx-generate-
packed-data.o test-full.pb.o -L<prefix dir>/lib <prefix dir>//lib/
libprotobuf.so -Wl,--rpath -Wl,<prefix dir>//lib -Wl,--rpath -
Wl,<prefix dir>//lib
test-full.pb.o: In function `google::protobuf::GoogleOnceInit(int*,
void (*)())':
test-full.pb.cc:(.text._ZN6google8protobuf14GoogleOnceInitEPiPFvvE
[google::protobuf::GoogleOnceInit(int*, void (*)())]+0x14): undefined
reference to `pthread_once'
collect2: ld returned 1 exit status
make[2]: *** [cxx-generate-packed-data] Error 1

I'd appreciate any ideas. I'm at a loss here.

Some technical details:
protobuf 2.1.0
protobuf-c 0.11
OS RedHat 5.2 i386
gcc 4.3.1

Thank you very much,
Aviad

Kenton Varda

unread,
Sep 30, 2009, 5:44:16 PM9/30/09
to zavi, Protocol Buffers
I don't know if the author of protobuf-c frequents this discussion group.  You might try e-mailing him directly.
Reply all
Reply to author
Forward
0 new messages