Compile Error

From: WA Support <support@dont-contact.us>
Date: Fri, 26 Sep 2003 14:10:22 -0700

Hello,

I realize that this may be off topic a bit, but I can't figure this one
out.

I am trying to add MySQL (mysql-4.0.15) query capability in the
redirect.cc module for squid-3.0-PRE3-20030924.

I am running Redhat 7.3 with kernel 2.4.20-19.7,
glibc-2.2.5-43.i686 (from Redhat rpm), and gcc/g++ 3.2.3 from GNU
tarball.

When I include mysql.h to the redirect.cc module and try to compile
Squid, I get:

<snip>
if g++ -DHAVE_CONFIG_H
-DDEFAULT_CONFIG_FILE=\"/usr/local/squid/etc/squid.conf\" -I. -I.
-I../include -I. -I. -I../include -I../include
-I../lib/libTrie/include -Werror -Wall -Wpointer-arith -Wwrite-strings
-Wmissing-prototypes -Wcomments -g -O2 -MT redirect.o -MD -MP -MF
".deps/redirect.Tpo" \
  -c -o redirect.o `test -f 'redirect.cc' || echo './'`redirect.cc; \
then mv -f ".deps/redirect.Tpo" ".deps/redirect.Po"; \
else rm -f ".deps/redirect.Tpo"; exit 1; \
fi
In file included from mysql.h:107,
                 from redirect.cc:46:
../include/my_alloc.h:37: syntax error before `+' token
cc1plus: warnings being treated as errors

i.e.,
<snip from my_alloc.h>
00035 typedef struct st_mem_root
00036 {
00037 USED_MEM *free; /* blocks with free memory in
it */
00038 USED_MEM *used; /* blocks almost without free
memory */
<snip>

I don't understand what the g++ compiler is complaining about with the
syntax error before`+' token, I don't see a "+" token.

I added my_alloc.h (and other header files) from the MySQL distribution
to the Squid 'include' directory.

Also, I am not sure how to link in -lmysqlclient when I do finally get
redirect.cc to compile. Any help on this one would also be appreciated.

Any help with this would be greatly appreciated.

Thanks,

Murrah Boswell
Systems Administrator
Wild Apache Internet Services
support@wildapache.net
Received on Fri Sep 26 2003 - 15:08:04 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:20:42 MST