You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Jeff Barnes <jb...@yahoo.com> on 2009/09/29 18:35:49 UTC

apr include errors

I'm trying to link against apr 1.3.8 and I'm getting some strange errors...

make[1]: Entering directory `/home/jeff/dev/trunk/Development/Server/LoadTest/src/abr'
gcc -g -c y.tab.c -I/usr/local/apr/include
In file included from /usr/local/apr/include/apr-1/apr_pools.h:37,
                 from abr.y:7:
/usr/local/apr/include/apr-1/apr.h:285: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘apr_off_t’
In file included from /usr/local/apr/include/apr-1/apr_file_io.h:29,
                 from abr.h:4,
                 from abr.y:9:
/usr/local/apr/include/apr-1/apr_file_info.h:198: error: expected specifier-qualifier-list before ‘apr_off_t’
In file included from abr.h:4,
                 from abr.y:9:
/usr/local/apr/include/apr-1/apr_file_io.h:632: error: expected declaration specifiers or ‘...’ before ‘apr_off_t’
/usr/local/apr/include/apr-1/apr_file_io.h:859: error: expected declaration specifiers or ‘...’ before ‘apr_off_t’
abr.y: In function ‘main’:
abr.y:313: warning: assignment from incompatible pointer type
make[1]: *** [y.tab.o] Error 1

...

apr.h:
284 typedef  ssize_t         apr_ssize_t;
285 typedef  off64_t           apr_off_t;
286 typedef  socklen_t       apr_socklen_t;


The make targets (Makefile.am) in question are:

y.tab.c : $(YACCFILE) $(HFILES)
        echo $(LEXER)
        echo $(PARSER)
        $(PARSER) $(IPARSEFLAGS) $(YFLAGS) $(YACCFILE)

y.tab.o: y.tab.c
        $(CC) -g -c y.tab.c -I@LIBAPR@/include

I can run make successfully at home on Ubuntu Jaunty, but not at work on Ubuntu Jaunty. I used apt-get for the autotools on both. I built apr 1.3.8 on both environments.

Can someone point out some error or provide some guidance?

Many thanks.
Jeff Barnes

Re: apr include errors

Posted by Wes Garland <we...@page.ca>.
On Tue, Sep 29, 2009 at 8:24 PM, Bojan Smojver <bo...@rexursive.com> wrote:

> On Tue, 2009-09-29 at 09:35 -0700, Jeff Barnes wrote:
> > Can someone point out some error or provide some guidance?
>
> Looks like your generated C file is missing some includes. Have a look
> at the generated file and try to compile it by hand. Also, I'm guessing
> @LIBAPR@ is not blank, right?


I hypothosize that it's also possible that his includes are correct, but
that the right CPPFLAGS for largefile support on his platform are not in
use.  Notice that the complaint is centered around the availability of
off64_t.

I haven't read any sources, but this change might help things:

y.tab.o: y.tab.c
       $(CC) -g $(CFLAGS) $(CPPFLAGS) -c y.tab.c -I@LIBAPR@/include

If that doesn't, you could also try adding
y.tab.o: CPPFLAGS += -DPOSIX_SOURCE -DPOSIX_C_SOURCE=200112L

or maybe
y.tab.o: CPPFLAGS += -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE

or maybe
y.tab.o: CFLAGS += -std=gnu99

Note,  that XOPEN_SOURCE=500 mandates large files, and probably SUSv2 &
SUSv3.  The source-compatibility defines, e.g. the POSIX_SOURCE stuff,
should be defined somewhere by APR but for some reason isn't being specified
when building the scanner.  This is a bug in the makefile IMHO; I just
haven't had the chance to dig for the right solution.

Note also that the fellow with the changing behaviour when he moves to g++
may be inadvertenly changing C standards or related but invisible version
selectioning stuff in his platform's feature test macros.  For example, a
SUSv3 build normally requires C99 and 200112L posix source.  But g++ is not
C99, although it can have posix 20012L source semantics.  Yes, I know, this
crap is all horribly confusing.

Wes

-- 
Wesley W. Garland
Director, Product Development
PageMail, Inc.
+1 613 542 2787 x 102

Re: apr include errors

Posted by Bojan Smojver <bo...@rexursive.com>.
On Tue, 2009-09-29 at 09:35 -0700, Jeff Barnes wrote:
> Can someone point out some error or provide some guidance?

Looks like your generated C file is missing some includes. Have a look
at the generated file and try to compile it by hand. Also, I'm guessing
@LIBAPR@ is not blank, right?

-- 
Bojan


Re: apr include errors

Posted by Kevac Marko <ma...@kevac.org>.
Strangely, I have same error. When using g++ insead of gcc, everything
is fine. I am investigating right now...

On Tue, Sep 29, 2009 at 7:35 PM, Jeff Barnes <jb...@yahoo.com> wrote:
> I'm trying to link against apr 1.3.8 and I'm getting some strange errors...
>
> make[1]: Entering directory `/home/jeff/dev/trunk/Development/Server/LoadTest/src/abr'
> gcc -g -c y.tab.c -I/usr/local/apr/include
> In file included from /usr/local/apr/include/apr-1/apr_pools.h:37,
>                 from abr.y:7:
> /usr/local/apr/include/apr-1/apr.h:285: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘apr_off_t’
> In file included from /usr/local/apr/include/apr-1/apr_file_io.h:29,
>                 from abr.h:4,
>                 from abr.y:9:
> /usr/local/apr/include/apr-1/apr_file_info.h:198: error: expected specifier-qualifier-list before ‘apr_off_t’
> In file included from abr.h:4,
>                 from abr.y:9:
> /usr/local/apr/include/apr-1/apr_file_io.h:632: error: expected declaration specifiers or ‘...’ before ‘apr_off_t’
> /usr/local/apr/include/apr-1/apr_file_io.h:859: error: expected declaration specifiers or ‘...’ before ‘apr_off_t’
> abr.y: In function ‘main’:
> abr.y:313: warning: assignment from incompatible pointer type
> make[1]: *** [y.tab.o] Error 1
>
> ...
>
> apr.h:
> 284 typedef  ssize_t         apr_ssize_t;
> 285 typedef  off64_t           apr_off_t;
> 286 typedef  socklen_t       apr_socklen_t;
>
>
> The make targets (Makefile.am) in question are:
>
> y.tab.c : $(YACCFILE) $(HFILES)
>        echo $(LEXER)
>        echo $(PARSER)
>        $(PARSER) $(IPARSEFLAGS) $(YFLAGS) $(YACCFILE)
>
> y.tab.o: y.tab.c
>        $(CC) -g -c y.tab.c -I@LIBAPR@/include
>
> I can run make successfully at home on Ubuntu Jaunty, but not at work on Ubuntu Jaunty. I used apt-get for the autotools on both. I built apr 1.3.8 on both environments.
>
> Can someone point out some error or provide some guidance?
>
> Many thanks.
> Jeff Barnes
>



-- 
Marko Kevac