Apache Module + PB

23 views
Skip to first unread message

Mauro

unread,
Nov 18, 2009, 10:56:04 AM11/18/09
to Protocol Buffers
Hi,

I'm running Mac OS Tiger (powerpc-apple-darwin8-gcc-4.0.0) and new to C
++ and PB.

I'm developing an Apache module that should generate a response for a
given request, both encoded with Protocol Buffers.

I wrote an example.proto and compiled it into example.pb.h using
protoc. Then I included this example.pb.h in my mod_example.c file.

The matter comes when attemping to make:

make check
source='mod_example.c' object='mod_example.lo' libtool=yes \
depfile='.deps/mod_example.Plo' tmpdepfile='.deps/mod_example.TPlo' \
depmode=gcc3 /bin/sh ./depcomp \
/bin/sh ./libtool --mode=compile gcc -DPACKAGE_NAME=\"\" -
DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -
DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"mod_example\" -DVERSION=\"1.0\" -
DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -
DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -
DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -
DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -I. -I. -I/usr/local/apache2/
include -I/usr/include -I/usr/local/include -I/usr/include/gcc/darwin/
4.0/c++ -I/usr/include/gcc/darwin/4.0/c++/powerpc-apple-darwin8 -g -
O2 -c -o mod_example.lo `test -f 'mod_example.c' || echo
'./'`mod_example.c
gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\"
-DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"mod_example
\" -DVERSION=\"1.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -
DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -
DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -
DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -I. -I. -I/usr/
local/apache2/include -I/usr/include -I/usr/local/include -I/usr/
include/gcc/darwin/4.0/c++ -I/usr/include/gcc/darwin/4.0/c++/powerpc-
apple-darwin8 -g -O2 -c mod_example.c -MT mod_example.lo -MD -MP -
MF .deps/mod_example.TPlo -fno-common -DPIC -o .libs/mod_example.o
In file included from /usr/include/gcc/darwin/4.0/c++/string:44,
from protocols/realtime-bidding.pb.h:6,
from mod_example.c:5:
/usr/include/gcc/darwin/4.0/c++/powerpc-apple-darwin8/bits/c++config.h:
64: error: parse error before '__gnu_debug_def'
/usr/include/gcc/darwin/4.0/c++/powerpc-apple-darwin8/bits/c++config.h:
64: error: syntax error before '{' token
/usr/include/gcc/darwin/4.0/c++/powerpc-apple-darwin8/bits/c++config.h:
67: error: syntax error before '{' token

( ... a lot of similar errors in many files ... )

/usr/include/gcc/darwin/4.0/c++/bits/locale_classes.h:499: error:
syntax error before ':' token
/usr/include/gcc/darwin/4.0/c++/bits/locale_classes.h:500: error:
syntax error before ':' token
/usr/include/gcc/darwin/4.0/c++/bits/locale_classes.h:501: error:
syntax error before ':' token
/usr/include/gcc/darwin/4.0/c++/bits/locale_classes.h:502: error:
syntax error before ':' token
/usr/include/gcc/darwin/4.0/c++/bits/locale_classes.h:503: error:
syntax error before ':' token
/usr/include/gcc/darwin/4.0/c++/bits/locale_classes.h:504: error:
syntax error before ':' token
/usr/include/gcc/darwin/4.0/c++/bits/locale_classes.h: In function
'_M_add_reference':
/usr/include/gcc/darwin/4.0/c++/bits/locale_classes.h:507: error:
parse error before 'throw'
/usr/include/gcc/darwin/4.0/c++/bits/locale_classes.h:516: confused by
earlier errors, bailing out
make: *** [mod_example.lo] Error 1



I tried to change the include paths from /usr/include/gcc/darwin/4.0
to /usr/include/gcc/darwin/3.1 and some other versions available in my
system with same result.

I would really appreciate your help.

Cheers,

Mauro.

Jason Hsueh

unread,
Nov 18, 2009, 2:38:43 PM11/18/09
to Mauro, Protocol Buffers
It looks like you're running gcc on a .c file, so it's trying to compile as C, not C++. You can either invoke g++ or name your file with one of the recognized extensions: http://gcc.gnu.org/onlinedocs/gcc/Invoking-G_002b_002b.html#Invoking-G_002b_002b


--

You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To post to this group, send email to prot...@googlegroups.com.
To unsubscribe from this group, send email to protobuf+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.



Henner Zeller

unread,
Nov 18, 2009, 2:39:05 PM11/18/09
to Mauro, Protocol Buffers
Is there anything you include before realtime-bidding.pb.h in
mod_example.c that might be a broken include ?
Like it contains a declaration of a class that does not have a
semicolon after the final '}' ?

josh rotenberg

unread,
Nov 18, 2009, 2:53:56 PM11/18/09
to Mauro, Protocol Buffers
I've never done Apache module stuff in C++ (C only) but I'd guess
thats a good place to look first. I believe there are a few libraries
out there that take some of the pain out of doing Apache modules in
C++, so you might google around for those.

Josh

On Wed, Nov 18, 2009 at 7:56 AM, Mauro <mau...@gmail.com> wrote:

Mauro

unread,
Nov 19, 2009, 8:50:28 AM11/19/09
to Protocol Buffers
Haha, Jason was right!

I might be getting older... Like I always say. If you write some code,
compile it with the right compiler.

I'll do some research.

Cheers!

Mauro.

Hassan Monfared

unread,
May 16, 2012, 2:29:10 PM5/16/12
to prot...@googlegroups.com
modcplusplus is right solution for voiding such headaches.
I've no problem with modcpluplus + ( C++ Module ) + any c++ shared objects except PB.
I explained my problem recently in this group.
Cheers,
SKY
> > To unsubscribe from this group, send email to protobuf+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages