Sameer: You are missing the include path, specified with -I; you can get the correct syntax for your build by using apr-1-config.
That said, if you are planning on building something that resembles a web server, may I suggest writing an Apache module (plug-in) rather than using APR to build a web server? You'll get where you want to go a lot faster. Nick Kew wrote an excellent book on Apache 2 modules; the old "Writing Apache Modules in Perl and C" is still somewhat relevant as well. Wes On Wed, Mar 25, 2009 at 5:13 AM, SAMEER KUMAR <[email protected]>wrote: > I am new to APR. I am going to use it for developing a Apache like hybrid > architecture for OpenSIPS [www.opensips.org], which an open source SIP[RFC > 3261] server. > > I have downloaded APR and installed it on my Fedora 9 machine using the > configure and make commands. I tested the installation with testall. But I > am not able to use this in my programs and not able to link to the header > files in APR. > > I am using a cat1.c program to run, in which I am using functions of APR > module. I have tried these gcc commands: > > gcc -l lapr-1 /cat1.c > > *gcc /cat1.c -L. -lapr-1* > > my working directory is > > */usr/local/apr/lib* > > I am getting following set of errors: > > /cat1.c:1:23: error: apr_pools.h: No such file or directory > /cat1.c:2:25: error: apr_file_io.h: No such file or directory > /cat1.c: In function ‘main’: > /cat1.c:8: error: ‘apr_pool_t’ undeclared (first use in this function) > /cat1.c:8: error: (Each undeclared identifier is reported only once > /cat1.c:8: error: for each function it appears in.) > /cat1.c:8: error: ‘pool’ undeclared (first use in this function) > /cat1.c:9: error: ‘apr_file_t’ undeclared (first use in this function) > /cat1.c:9: error: ‘thefile’ undeclared (first use in this function) > /cat1.c:9: error: ‘NULL’ undeclared (first use in this function) > /cat1.c:10: error: ‘out’ undeclared (first use in this function) > /cat1.c:14: error: ‘apr_terminate’ undeclared (first use in this function) > /cat1.c:19: error: ‘APR_READ’ undeclared (first use in this function) > /cat1.c:19: error: ‘APR_CREATE’ undeclared (first use in this function) > /cat1.c:20: error: ‘APR_UREAD’ undeclared (first use in this function) > /cat1.c:20: error: ‘APR_UWRITE’ undeclared (first use in this function) > /cat1.c:20: error: ‘APR_GREAD’ undeclared (first use in this function) > /cat1.c:21: error: ‘APR_SUCCESS’ undeclared (first use in this function) > /cat1.c:25: error: ‘APR_EOF’ undeclared (first use in this function) > /cat1.c:26: error: ‘apr_size_t’ undeclared (first use in this function) > /cat1.c:26: error: expected ‘;’ before ‘bytes’ > /cat1.c:29: error: ‘bytes’ undeclared (first use in this function) > /cat1.c:29: warning: incompatible implicit declaration of built-in function > ‘strlen’ > > > Can some one help me where I am lacking. Can some one track my mistake. I > will be very grateful if someone can do that. :) > > Thank You in advance. > > Sameer Kumar > B.Tech, Computer Engineering > Institute of Technology, > Nirma University, > Ahmedabad, Gujarat > > -- Wesley W. Garland Director, Product Development PageMail, Inc. +1 613 542 2787 x 102
