[prev in list] [next in list] [prev in thread] [next in thread]
List: apr-dev
Subject: apr MSVC 2003 linking problems
From: "halplus shadowbit" <halplus () gmail ! com>
Date: 2007-01-27 21:32:32
Message-ID: b64a985e0701271332g8ee96b3rc5911ce6cba87ab9 () mail ! gmail ! com
[Download RAW message or body]
Hello:
I'm getting this with Visual Studio 2003 with different versions of apr
0.9.x, 1.0.0 and the latest stable release. I am using c not c++
jpr.obj : error LNK2019: unresolved external symbol
__imp__apr_pool_create_ex@16 referenced in function _jpr_initialize@0
jpr.obj : error LNK2019: unresolved external symbol
__imp__apr_app_initialize@12 referenced in function _jpr_initialize@0
jpr.obj : error LNK2019: unresolved external symbol __imp__apr_terminate
referenced in function _jpr_terminate@0
jpr.obj : error LNK2019: unresolved external symbol
__imp__apr_pool_destroy@4 referenced in function _jpr_terminate@0
jpr_excep.obj : error LNK2019: unresolved external symbol
__imp__apr_threadkey_private_create@12 referenced in function
_jpr_excep_initialize
jpr_excep.obj : error LNK2019: unresolved external symbol
__imp__apr_threadkey_private_delete@4 referenced in function
_jpr_excep_terminate
jpr_excep.obj : error LNK2019: unresolved external symbol
__imp__apr_threadkey_private_set@8 referenced in function
__jpr_threadPushCtx@8
jpr_excep.obj : error LNK2019: unresolved external symbol
__imp__apr_threadkey_private_get@8 referenced in function
__jpr_threadPushCtx@8
It sould be linking for example with _apr_pool_create_ex@16 instead of
__imp__apr_pool_create_ex@16 at least that is the name the library is
exporting
Do I need to change something in the headers or... maybe define a symbol or
something else?
/* -------------------- This is the fragment of code that calls the macro
apr_pool_create --------------------------- */
#include <apr_general.h>
#include <apr_pools.h>
#include "jpr_core.h"
#include "jpr_priv.h"
apr_pool_t *_jpr_global_pool = NULL;
static unsigned int _jpr_initialized = 0;
#ifdef WIN32
static int _targc = 0;
static char **_targv = NULL;
#endif
JPR_DECLARE(Jpr_status) jpr_initialize(void)
{
apr_status_t rv;
if (_jpr_initialized++) {
return APR_SUCCESS;
}
#ifdef WIN32
if (_targc != __argc)
_targc = __argc;
if (_targv != __argv)
_targv = __argv;
rv = apr_app_initialize(&_targc, &_targv, NULL);
#else
rv = apr_initialize();
#endif
if (APR_SUCCESS == rv) {
rv = apr_pool_create(&_jpr_global_pool, NULL);
}
if (APR_SUCCESS == rv) {
rv = jpr_excep_initialize();
}
if (APR_SUCCESS != rv) {
_jpr_initialized = 0;
}
return rv;
}
/* ------------------------------------------------------------------ */
Thanks in advance for your help
David
[Attachment #3 (text/html)]
Hello:<br><br>I'm getting this with Visual Studio 2003 with different versions of \
apr 0.9.x, 1.0.0 and the latest stable release. I am using c not c++<br><br>jpr.obj : \
error LNK2019: unresolved external symbol __imp__apr_pool_create_ex@16 referenced in \
function _jpr_initialize@0 <br>jpr.obj : error LNK2019: unresolved external symbol \
__imp__apr_app_initialize@12 referenced in function _jpr_initialize@0<br>jpr.obj : \
error LNK2019: unresolved external symbol __imp__apr_terminate referenced in function \
_jpr_terminate@0 <br>jpr.obj : error LNK2019: unresolved external symbol \
__imp__apr_pool_destroy@4 referenced in function _jpr_terminate@0<br>jpr_excep.obj : \
error LNK2019: unresolved external symbol __imp__apr_threadkey_private_create@12 \
referenced in function _jpr_excep_initialize <br>jpr_excep.obj : error LNK2019: \
unresolved external symbol __imp__apr_threadkey_private_delete@4 referenced in \
function _jpr_excep_terminate<br>jpr_excep.obj : error LNK2019: unresolved external \
symbol __imp__apr_threadkey_private_set@8 referenced in function \
__jpr_threadPushCtx@8 <br>jpr_excep.obj : error LNK2019: unresolved external symbol \
__imp__apr_threadkey_private_get@8 referenced in function \
__jpr_threadPushCtx@8<br><br><br>It sould be linking for example with \
_apr_pool_create_ex@16 instead of __imp__apr_pool_create_ex@16 at least that is the \
name the library is exporting <br><br>Do I need to change something in the headers \
or... maybe define a symbol or something else?<br><br><br><br><br><br>/* \
-------------------- This is the fragment of code that calls the macro \
apr_pool_create --------------------------- */ <br><br>#include \
<apr_general.h><br>#include <apr_pools.h><br><br>#include \
"jpr_core.h"<br>#include "jpr_priv.h"<br><br>apr_pool_t \
*_jpr_global_pool = NULL;<br>static unsigned int _jpr_initialized = 0; <br>#ifdef \
WIN32<br>static int _targc = 0;<br>static char **_targv = \
NULL;<br>#endif<br><br>JPR_DECLARE(Jpr_status) \
jpr_initialize(void)<br>{<br> apr_status_t \
rv;<br><br> if (_jpr_initialized++) \
{<br> return APR_SUCCESS; \
<br> }<br><br>#ifdef WIN32<br> if (_targc != \
__argc)<br> _targc = \
__argc;<br><br> if (_targv != \
__argv)<br> _targv = \
__argv;<br><br> rv = apr_app_initialize(&_targc, &_targv, \
NULL);<br>#else <br> rv = \
apr_initialize();<br>#endif<br> if (APR_SUCCESS == rv) \
{<br> rv = \
apr_pool_create(&_jpr_global_pool, NULL);<br> \
}<br><br> if (APR_SUCCESS == rv) \
{<br> rv = jpr_excep_initialize();<br> \
}<br><br> if (APR_SUCCESS != rv) \
{<br> _jpr_initialized = \
0;<br> }<br><br> return rv;<br>}<br><br>/* \
------------------------------------------------------------------ \
*/<br><br><br><br>Thanks in advance for your help <br>David
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic