apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lucian Adrian Grijincu" <lucian.griji...@gmail.com>
Subject Re: Newbie question : compiling helloworld.c on ubuntu7.10
Date Mon, 12 May 2008 13:03:05 GMT
On Mon, May 12, 2008 at 3:45 PM, dharmarth <dharmarth@gmail.com> wrote:
>
>  Hi
>  I have successfully compiled and build APR on ubuntu7.10.
>  I am trying to run following hello world program.
>
>  #include <stdio.h>
>  #include <apr.h>
>  #include <apr_general.h>
>
>  int main(int argc, const char *argv[])
>  {
>      apr_status_t rv;
>      rv = apr_initialize();
>      printf( "Hello world!\n");
>      apr_terminate();
>      return 0;
>  }
>
>  I am giving following command to generate executable.
>
>  gcc hello_world_apr.c -I"/usr/local/apr/include/apr-1"
>  -L"/usr/local/apr/lib" -lapr-1
>
>  But, it doesnt compile and gives following error trace.
>
>  In file included from hello_world_apr.c:2:
>  /usr/local/apr/include/apr-1/apr.h:273: error: expected '=', ',', ';', 'asm'
>  or '__attribute__' before 'apr_off_t'
>
you need -D_LARGEFILE64_SOURCE
better use apr-1-config.
$ apr-1-config --cppflags --includes --libs --link-ld
-DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE
-I/usr/include/apr-1.0  -luuid -lrt -lcrypt  -lpthread -ldl -L/usr/lib
-lapr-1

-- 
Lucian

Mime
View raw message