apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Myers, Gary - 43" <gary.my...@rainhail.com>
Subject RE: Newbie question: Compiling helloworld-APR.c under Windows
Date Fri, 25 Jan 2008 19:09:22 GMT
Another possibility is to use MSYS from http://www.mingw.org/ I've use
that on Windows to compile APR with not much trouble.  Since you want to
port you code to multiple platforms you would probably be better served
using something like that anyway.  There are two problems with using
MSYS, there is no perfect IDE for it, and for some reason the build
system as provided doesn't build the dll's, but it does build the
assemblies so you can get the dll's out of them.  (It could also be
because I couldn't figure out how to make the build system do it.)

The log4cxx guys have some good instructions on compiling with MSYS and
Mingw
http://wiki.apache.org/logging-log4cxx/MSWindowsBuildInstructions

And if you want a pretty good C/C++ IDE that is free there is a good one
from the eclipse project that plays nice with the Mingw port of GCC.
The only thing you need that the log4cxx instructions don't tell you is
that you'll probably want 
pkg-config so you don't have to type out the long list of linking flags.

Hope this helps. 

-----Original Message-----
From: Joachim Ziegler [mailto:ziegler@mpi-sb.mpg.de] 
Sent: Friday, January 25, 2008 2:37 AM
To: dev@apr.apache.org
Subject: Newbie question: Compiling helloworld-APR.c under Windows

Hello,

we are evaluating APR as a possible base for a multi-platform server 
project.

I have successfully compiled and executed the following APR-"Hello 
world!" program under Unix:

#include <stdio.h>
#include <apr_general.h>

int main(int argc, const char *argv[])
{
     apr_status_t rv;
     rv = apr_initialize();
     printf( "Hello APR world!\n");
     apr_terminate();
     return 0;
}


Now I try to compile this with Visual Studio 8 (2005). I have 
successfully built the APR libs and the test suite with Studio.

But when compiling the above program, I get the following error message:

------ Build started: Project: TestAPR, Configuration: Debug Win32
------
Compiling...
try-helloworld-APR.c
d:\apr\apr\include\apr_errno.h(52) : error C2061: syntax error : 
identifier 'apr_strerror'
d:\apr\apr\include\apr_errno.h(52) : error C2059: syntax error : ';'
d:\apr\apr\include\apr_errno.h(52) : error C2059: syntax error : 'type'

The respective line in apr_errno.c reads

APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
                                  apr_size_t bufsize);

It seems that the macro APR_DECLARE is not defined.

I have spent one day to read all available documentation on APR and have

searched the mailing list archive for messages concerning how to compile

with APR under windows, but I just could not find out what settings I 
have to specify to use the APR libs with Visual Studio.

The page http://apr.apache.org/compiling_win32.html just says

>  Integrating the Library
> 
>     We should tell ya'll 'bout this, no?

:-)

Can you please help me? Any hints are highly appreciated.

Thank you and kind regards,
Joachim


Mime
View raw message