axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Raghavendra SM" <>
Subject RE: Axis2C: linker error: _axutil_error_messages
Date Thu, 20 Sep 2007 03:06:53 GMT
Even we faced this linker error. It’s because of axutil_error_messages
being defined multiple times, as it is defined in a header

It can be taken care by prefixing the extern in that header like below,


extern const axis2_char_t* axutil_error_messages[AXIS2_ERROR_LAST +


And, then define the array in error.c file.






From: Michael Mole [] 
Sent: Thursday, September 20, 2007 1:08 AM
To: Apache AXIS C User List
Subject: Axis2C: linker error: _axutil_error_messages


I'm getting a linker error and cannot figure out how to resolve it.  I'm
wondering if anyone else has seen a linker error about
_axutil_error_messages?  The scenario is described below. 

I am coding in C++ and have two classes: class_A and class_B. 

Class_A has a private member of type axis2_char_t*.  It in turn has an
include statement: #include <axis2_util.h>. 

Class_B has a private member of type "class_A*."  It in turn has an
include statement: #include <class_A.h>.  Class_B has no references to
any axis headers or types. 

I'm trying to create a dll, but when I build (on Windows), I get an
error at the linker stage and in turn failure which says: 
class_B.o : warning LNK4006: _axutil_error_messages already defined in
class_A.o; second definition ignored 
LIB : error LNK1218: warning treated as error; no output file generated 
*** Error code 4006 

I checked the symbol tables for class_A.o and class_B.o and they both
contain  "_axutil_error_messages". 

Beyond this, I'm stuck.  Why is this symbol showing up in both places?
Am I linking correctly?  Any help is greatly appreciated. 

Thank you, 

Michael J Molé
Software Engineer
IBM Software Group - Rational

View raw message