Re: Can not include my code into squid

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Tue, 04 Oct 2011 10:39:54 -0600

On 10/04/2011 09:21 AM, Arthur Tumanyan wrote:
> Hi,all. I have some troubles.When I trying make squid with my sources
> (SquidShell.cc,SquidShell.h),I got
> error:
> /root_at_dreambox:/home/arthur/workspace/squid# make
> Making all in compat
> make[1]: Entering directory `/home/arthur/workspace/squid/compat'
> g++ -DHAVE_CONFIG_H -I.. -I../include -I../lib -I../src -I../include
> -Wall -Wpointer-arith -Wwrite-strings -Wcomments -Werror -pipe -D_REENTRANT
> -g -O2 -MT assert.o -MD -MP -MF .deps/assert.Tpo -c -o assert.o assert.cc
> In file included from ../include/config.h:68:0,
> from assert.cc:34:
> ../src/shell/SquidShell.h:9:18: error: ‘StoreEntry’ has not been declared
> make[1]: *** [assert.o] Error 1
> make[1]: Leaving directory `/home/arthur/workspace/squid/compat'
> make: *** [all-recursive] Error 1
> root_at_dreambox:/home/arthur/workspace/squid#
> /
> then I add #include "Store.h" to SquidShell.h
> and getting this:
> /Making all in compat
> make[1]: Entering directory `/home/arthur/workspace/squid/compat'
> g++ -DHAVE_CONFIG_H -I.. -I../include -I../lib -I../src -I../include
> -Wall -Wpointer-arith -Wwrite-strings -Wcomments -Werror -pipe -D_REENTRANT
> -g -O2 -MT assert.o -MD -MP -MF .deps/assert.Tpo -c -o assert.o assert.cc
> In file included from ../include/snmp.h:74:0,
> from ../include/cache_snmp.h:19,
> from ../src/squid.h:158,
> from ../src/Store.h:40,
> from ../src/shell/SquidShell.h:4,
> from ../include/config.h:68,
> from assert.cc:34:
> ../include/snmp_debug.h:7:56: error: expected initializer before
> ‘PRINTF_FORMAT_ARG2’
...
> make[1]: *** [assert.o] Error 1
> make[1]: Leaving directory `/home/arthur/workspace/squid/compat'
> make: *** [all-recursive] Error 1
> root_at_dreambox:/home/arthur/workspace/squid#
> /
> Can't get rid of this trouble.Can someone point me,what I'm doing wrong?
> Thanx.
>
> My source files already included in Makefile,and configure.in. I have no
> problem with that.I could even make a squid example with empty SquidShell.cc
> and SquidShell.h files

Hard to say without seeing your code (you should post a diff), but it
sounds like you are #including SquidShell.h header file in
include/config.h, which is wrong. Virtually nothing outside src/shell/
(and most certainly not config.h!) should know about SquidShell.h.

For example, squid/compat should build fine even if you put unparsable
garbage inside SquidShell.h.

HTH,

Alex.
Received on Tue Oct 04 2011 - 16:40:05 MDT

This archive was generated by hypermail 2.2.0 : Tue Oct 04 2011 - 12:00:05 MDT