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 Wed, 06 Feb 2008 14:25:41 GMT
Let me tell you exactly what I did.

I tried to follow as much as possible the information given on

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

Again, I must admit that I have not used Visual Studio much in the past. 
I come from a UNIX background. Maybe I do wrong something very basic.

I try to compile and link the following minimal program against the 
static APR libraries within visual Studio 2005:

#include <apr.h>
#include <apr_general.h>
int main(int argc, const char *argv[])
{
   apr_initialize();
   apr_terminate();
   return 0;
}

My installation of APR resides below D:\apr.

I created a new project APRTest in Visual Studio. On the properties 
pages of this project, I entered:

- C/C++/General/Additional Include Directories:

D:\apr\apr\include;D:\apr\apr-util\include

- C/C++/Preprocessor/Preprocessor definitions:

WIN32
APR_DECLARE_STATIC
APU_DECLARE_STATIC

- Linker/Input/Additional dependencies:

D:\apr\apr\LibD\apr-1.lib
D:\apr\apr-util\LibD\aprutil-1.lib


Now I got the following error messages:


------ Build started: Project: APRTest, Configuration: Debug Win32 ------
Linking...
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _free already defined in 
LIBCMT.lib(free.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _isupper already defined in 
LIBCMT.lib(_ctype.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _atoi already defined in 
LIBCMT.lib(atox.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _isdigit already defined in 
LIBCMT.lib(_ctype.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _strchr already defined in 
LIBCMT.lib(strchr.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _malloc already defined in 
LIBCMT.lib(malloc.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _getenv already defined in 
LIBCMT.lib(getenv.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _isspace already defined in 
LIBCMT.lib(_ctype.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: ___doserrno already defined 
in LIBCMT.lib(dosmap.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _memmove already defined in 
LIBCMT.lib(memmove.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _strncmp already defined in 
LIBCMT.lib(strncmp.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: __strtoi64 already defined in 
LIBCMT.lib(strtoq.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: __errno already defined in 
LIBCMT.lib(dosmap.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _islower already defined in 
LIBCMT.lib(_ctype.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _isalpha already defined in 
LIBCMT.lib(_ctype.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _strtol already defined in 
LIBCMT.lib(strtol.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: __stricmp already defined in 
LIBCMT.lib(stricmp.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: __strnicmp already defined in 
LIBCMT.lib(strnicmp.obj)
LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other 
libs; use /NODEFAULTLIB:library
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(select.obj) : error LNK2019: unresolved external symbol 
___WSAFDIsSet@8 referenced in function _apr_poll@20
apr-1.lib(select.obj) : error LNK2019: unresolved external symbol 
__imp__WSAGetLastError@0 referenced in function _apr_poll@20
apr-1.lib(sockaddr.obj) : error LNK2001: unresolved external symbol 
__imp__WSAGetLastError@0
apr-1.lib(select.obj) : error LNK2019: unresolved external symbol 
__imp__select@20 referenced in function _apr_poll@20
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__getsockname@12 referenced in function _get_local_addr
apr-1.lib(sockaddr.obj) : error LNK2019: unresolved external symbol 
__imp__getpeername@12 referenced in function _get_remote_addr
apr-1.lib(sockaddr.obj) : error LNK2019: unresolved external symbol 
__imp__gethostbyname@4 referenced in function _find_addresses
apr-1.lib(sockaddr.obj) : error LNK2019: unresolved external symbol 
__imp__inet_addr@4 referenced in function _find_addresses
apr-1.lib(sockaddr.obj) : error LNK2019: unresolved external symbol 
__imp__gethostbyaddr@12 referenced in function _apr_getnameinfo@12
apr-1.lib(sockaddr.obj) : error LNK2019: unresolved external symbol 
__imp__getservbyname@8 referenced in function _apr_getservbyname@8
apr-1.lib(sockaddr.obj) : error LNK2019: unresolved external symbol 
__imp__htonl@4 referenced in function _apr_ipsubnet_create@16
D:\APRTest\Debug\APRTest.exe : fatal error LNK1120: 15 unresolved externals
Build log was saved at "file://d:\APRTest\APRTest\Debug\BuildLog.htm"
APRTest - 36 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========



Joachim

Mime
View raw message