apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joachim Ziegler <zieg...@mpi-sb.mpg.de>
Subject Re: Newbie question: Compiling helloworld-APR.c under Windows
Date Tue, 05 Feb 2008 12:42:45 GMT
Hello William,

thank you for your quick reply last week.

Unfortunately I still cannot get helloworld-APR.c running under Windows.

William A. Rowe, Jr. wrote:
> If you used a -win32-src.zip file, and run nmake against the
> makefile.win, you shouldn't be having problems.

I'm not quite sure to understand what you mean by this. Yes, I have 
downloaded the win32-src.zip file and followed the instructions in the 
section "Developer Studio Workspace/Microsoft Development Environment 
IDE Build" on

http://apr.apache.org/compiling_win32.html

to build the libs.

I have also successfully built and run the apr/test/aprtest.dsw project.

> 
> If you import into VS2005/2008, there are dependency hassles,
> but you can usually work those out by reviewing the build
> target and it's dependencies.  APR alone is pretty easy.

Sorry, I do not understand what you say here. It might well be that I 
just know too little about Windows programming in general. (I come from 
a UNIX background.)

> Finally, apr.h defines those APR_DECLARE macros to be .dll
> imports if you do nothing.  You do need to declare -D WIN32
> of course.

I have found out by myself that I have to declare this WIN32 macro by 
following the compiler's error messages into the apr.h file. You say "of 
course": Is this something I should have known beforehand because it is 
customary in Windows development? If not so: I cannot read anything 
about this in the official documentation!?

Anyway, now my helloworld compiles, but it does not link. I get the 
following error messages:

------ Build started: Project: TestAPR, Configuration: Debug Win32 ------
Linking...
try-helloworld-APR.obj : warning LNK4075: ignoring '/EDITANDCONTINUE' 
due to '/OPT:ICF' specification
apr-1.lib(start.obj) : error LNK2019: unresolved external symbol 
__imp__WSACleanup@0 referenced in function _apr_initialize@0
apr-1.lib(start.obj) : error LNK2019: unresolved external symbol 
__imp__WSAStartup@8 referenced in function _apr_initialize@0
apr-1.lib(apr_snprintf.obj) : error LNK2019: unresolved external symbol 
__imp__ntohl@4 referenced in function _conv_in_addr
apr-1.lib(sockaddr.obj) : error LNK2001: unresolved external symbol 
__imp__ntohl@4
apr-1.lib(sockaddr.obj) : error LNK2019: unresolved external symbol 
__imp__htons@4 referenced in function _apr_sockaddr_vars_set
apr-1.lib(sockaddr.obj) : error LNK2019: unresolved external symbol 
__imp__ntohs@4 referenced in function _get_local_addr
apr-1.lib(sockaddr.obj) : error LNK2019: unresolved external symbol 
__imp__WSAGetLastError@0 referenced in function _get_local_addr
[...]

Can someone please help me?

Thank you very much,
Joachim

Mime
View raw message