Favicon

Build log4cxx as static library using MS Visual Studio 2003

Hello *,

I ma trying to build log4cxx as static library using MS Visual Studio 2003, but it doesn’t work. I have opened the project log4cxx.dsw of the log4cxx package, converted it to a MS Visual Studio 2003 project, set the project “log4cxx” as start-up project and changed two properties:

- build “static library” not “dynamic library”

-  and the pre-processor definition “LOG4CXX” to “LOG4CXX_STATIC”

 

When linking during the build process I get 544 warnings like the followings:

apr-1.lib(dir.obj) : warning LNK4006: _apr_os_dir_put <at> 12 already defined in aprutil-1.lib(dir.obj); second definition ignored

apr-1.lib(fileacc.obj) : warning LNK4006: _apr_file_name_get <at> 8 already defined in aprutil-1.lib(fileacc.obj); second definition ignored

 

Linking my own test project with the build static library results in the following errors:

log4cxx.lib(start.obj) : error LNK2019: unresolved external symbol __imp__WSACleanup <at> 0 referenced in function _apr_initialize <at> 0

log4cxx.lib(start.obj) : error LNK2019: unresolved external symbol __imp__WSAStartup <at> 8 referenced in function _apr_initialize <at> 0

log4cxx.lib(apr_snprintf.obj) : error LNK2019: unresolved external symbol __imp__ntohl <at> 4 referenced in function _conv_in_addr

log4cxx.lib(sockaddr.obj) : error LNK2001: unresolved external symbol __imp__ntohl <at> 4

log4cxx.lib(sockaddr.obj) : error LNK2019: unresolved external symbol __imp__htons <at> 4 referenced in function _apr_sockaddr_vars_set

 

What have I to do to get the static library running? Please help.

 

Thanks

Markus

 


Gmane