axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tammy Martin" <>
Subject Re: forward declaration in generated adb files causes a C++ error
Date Fri, 05 Sep 2008 00:50:25 GMT
Hello Dimuthu,

Sorry for the delay in response...I tried your fix but unfortunately it did
not work for me.

It appears that the structure definition and the typedef need to be in the
header file in order for the C++ to compile...
Like this:

#include <stdio.h>
#include <axiom.h>
#include <axis2_util.h>
#include <axiom_soap.h>
#include <axis2_client.h>

struct adb_return
  axutil_qname_t* qname;
  axis2_char_t* property_return;
  axis2_bool_t is_valid_return;
   *  adb_return class
typedef struct adb_return adb_return_t;

#ifdef __cplusplus
  extern "C"

And there can be NO structure definition in the generated .c file other wise
it is duplicated...

It doesn't seem to matter if it is in the extern "C" declaration or not..

I am getting these errors because I am including the adb_return.h inside my
C++ code. and then I get errors regarding a forward declaraion of struct

error: invalid use of undefined type `struct adb_return'

error: forward declaration of `struct adb_return'

I am trying to fix this by modifying the CADBBeanTemplateHeader.xsl and
CADBBeanTemplateSource.xsl any help you could provide would be greatly

If there are any other workarounds for this error, compiler flags or
anything I may be missing, please let me know.



On 8/25/08, Dimuthu Gamage <> wrote:
> Hi,
> Yea it is a bug, and i just fixed it in the SVN. In fact you can fix it
> without needing to compile the source.
> extract the adb-codegen-*.jar and  check
> "org/apache/axis2/schema/template/CADBBeanTemplateHeader.xsl" for a
> template.
> Thanks
> Dimuthu
> On Thu, Aug 21, 2008 at 12:28 PM, Tammy Martin <>wrote:
>> Hello,
>> I am using axis2c 1.3.0 and axis2 1.4 and used the tool to
>> generate (adb) axis data bindings from a wsdl. I am using these data
>> bindings in a C++ program. When I compile on Linux I get the following
>> error:
>> error: forward declaration of `struct adb_return'
>> this is what it looks like in the header is outside of the
>> extern 'C" declaration.
>>  typedef struct adb_return adb_return_t;
>> In order to get this to compile I have to change it to: (which I placed
>> inside of the extern "C" declaration.
>>  /**
>>         *  adb_return class
>>         */
>>         typedef struct {
>>           axutil_qname_t* qname;
>>        axis2_char_t* property_return;
>>        axis2_bool_t is_valid_return;
>>         } adb_return_t;
>> My question is this, how can I get axis2c to generate databindings that I
>> do not have to manipulate manually in order to compile. Is there an option I
>> am missing on the wsdl2c generation or is there a bug fix that I can obtain?
>> Thanks for your help,
>> Tammy

View raw message