You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-user@axis.apache.org by Michael Mole <mj...@us.ibm.com> on 2007/09/25 19:36:29 UTC

Axis2C: compile error - 'struct' type redefinition

I am getting some compile errors that I cannot resolve.  I'm wondering if 
this is a known issue or if I'm doing something wrong.  Here is the 
scenario:

I have a C++ class that includes <axiom.h>, <axis2_util.h>, and 
<axis2_stub.h>.
It also includes sys/types.h
When I compile it's complaining about these struct redefinitions.  I'm 
wondering if these structs are defined properly or am I missing some flag 
when I build?

Here are the actual errors:

c:\axis2c-src-1.1.0\build\deploy\include\platforms\windows\axutil_dir_windows.h(30) 
: error C2011: 'dirent' :
'struct' type redefinition
        \atria\nt\include\dirent.h(16) : see declaration of 'dirent'
c:\axis2c-src-1.1.0\build\deploy\include\platforms\windows\axutil_dir_windows.h(48) 
: error C2371: 'DIR' : red
efinition; different basic types
        \atria\nt\include\dirent.h(27) : see declaration of 'DIR'
c:\axis2c-src-1.1.0\build\deploy\include\platforms\windows\axutil_dir_windows.h(56) 
: error C2373: 'opendir' :
 redefinition; different type modifiers
        \atria\nt\include\dirent.h(29) : see declaration of 'opendir'
c:\axis2c-src-1.1.0\build\deploy\include\platforms\windows\axutil_dir_windows.h(62) 
: error C2373: 'closedir'
: redefinition; different type modifiers
        \atria\nt\include\dirent.h(32) : see declaration of 'closedir'
c:\axis2c-src-1.1.0\build\deploy\include\platforms\windows\axutil_dir_windows.h(69) 
: error C2373: 'readdir' :
 redefinition; different type modifiers
        \atria\nt\include\dirent.h(30) : see declaration of 'readdir'
c:\axis2c-src-1.1.0\build\deploy\include\platforms\windows\axutil_dir_windows.h(80) 
: error C2556: 'int rewind
dir(DIR *)' : overloaded function differs only by return type from 'void 
rewinddir(DIR *)'
        \atria\nt\include\dirent.h(31) : see declaration of 'rewinddir'
c:\axis2c-src-1.1.0\build\deploy\include\platforms\windows\axutil_dir_windows.h(80) 
: error C2373: 'rewinddir'
 : redefinition; different type modifiers
        \atria\nt\include\dirent.h(31) : see declaration of 'rewinddir'

Thanks,
Mike

Michael J Molé
Software Engineer
IBM Software Group - Rational
(781)676-2710

Re: Axis2C: compile error - 'struct' type redefinition

Posted by Michael Mole <mj...@us.ibm.com>.
Let me first correct myself from before.  The two conflicting headers are 
dirent.h and axis2_util.h.

The following is a code snippet that will fail.  Unfortunately, I can't 
just take out the #include <dirent.h> statement because my real code isn't 
including it directly.  It's really buried deep within a chain of includes 
of other headers (i.e. I include foo1.hxx which includes foo2.hxx which 
includes dirent.h)

// Foo.hxx
#ifndef FOO_HXX
#define FOO_HXX

class Foo
{
public:
   Foo();
   ~Foo();

private:

};

#endif


// Foo.cxx
#include "Foo.hxx"

#include <dirent.h>
#include <axis2_util.h>
 

Foo::Foo()
{
}

Foo::~Foo()
{
}


Thanks,
Mike

Michael J Molé
Software Engineer
IBM Software Group - Rational
(781)676-2710



Samisa Abeysinghe <sa...@gmail.com> 
09/26/2007 06:38 AM
Please respond to
"Apache AXIS C User List" <ax...@ws.apache.org>


To
Apache AXIS C User List <ax...@ws.apache.org>
cc

Subject
Re: Axis2C: compile error - 'struct' type redefinition






Can you send the program source so that I would try to compile and see.

Samisa...

Michael Mole wrote:
>
> I am getting some compile errors that I cannot resolve.  I'm wondering 
> if this is a known issue or if I'm doing something wrong.  Here is the 
> scenario:
>
> I have a C++ class that includes <axiom.h>, <axis2_util.h>, and 
> <axis2_stub.h>.
> It also includes sys/types.h
> When I compile it's complaining about these struct redefinitions.  I'm 
> wondering if these structs are defined properly or am I missing some 
> flag when I build?
>
> Here are the actual errors:
>
> 
c:\axis2c-src-1.1.0\build\deploy\include\platforms\windows\axutil_dir_windows.h(30) 

> : error C2011: 'dirent' :
> 'struct' type redefinition
>         \atria\nt\include\dirent.h(16) : see declaration of 'dirent'
> 
c:\axis2c-src-1.1.0\build\deploy\include\platforms\windows\axutil_dir_windows.h(48) 

> : error C2371: 'DIR' : red
> efinition; different basic types
>         \atria\nt\include\dirent.h(27) : see declaration of 'DIR'
> 
c:\axis2c-src-1.1.0\build\deploy\include\platforms\windows\axutil_dir_windows.h(56) 

> : error C2373: 'opendir' :
>  redefinition; different type modifiers
>         \atria\nt\include\dirent.h(29) : see declaration of 'opendir'
> 
c:\axis2c-src-1.1.0\build\deploy\include\platforms\windows\axutil_dir_windows.h(62) 

> : error C2373: 'closedir'
> : redefinition; different type modifiers
>         \atria\nt\include\dirent.h(32) : see declaration of 'closedir'
> 
c:\axis2c-src-1.1.0\build\deploy\include\platforms\windows\axutil_dir_windows.h(69) 

> : error C2373: 'readdir' :
>  redefinition; different type modifiers
>         \atria\nt\include\dirent.h(30) : see declaration of 'readdir'
> 
c:\axis2c-src-1.1.0\build\deploy\include\platforms\windows\axutil_dir_windows.h(80) 

> : error C2556: 'int rewind
> dir(DIR *)' : overloaded function differs only by return type from 
> 'void rewinddir(DIR *)'
>         \atria\nt\include\dirent.h(31) : see declaration of 'rewinddir'
> 
c:\axis2c-src-1.1.0\build\deploy\include\platforms\windows\axutil_dir_windows.h(80) 

> : error C2373: 'rewinddir'
>  : redefinition; different type modifiers
>         \atria\nt\include\dirent.h(31) : see declaration of 'rewinddir'
>
> Thanks,
> Mike
>
> Michael J Molé
> Software Engineer
> IBM Software Group - Rational
> (781)676-2710 


-- 
Samisa Abeysinghe - Apche Axis2/C
"
http://ws.apache.org/axis2/c/?Apache&nbsp;Axis2/C&nbsp;The&nbsp;Web&nbsp;Services&nbsp;Engine
"


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org



Re: Axis2C: compile error - 'struct' type redefinition

Posted by Samisa Abeysinghe <sa...@gmail.com>.
Can you send the program source so that I would try to compile and see.

Samisa...

Michael Mole wrote:
>
> I am getting some compile errors that I cannot resolve.  I'm wondering 
> if this is a known issue or if I'm doing something wrong.  Here is the 
> scenario:
>
> I have a C++ class that includes <axiom.h>, <axis2_util.h>, and 
> <axis2_stub.h>.
> It also includes sys/types.h
> When I compile it's complaining about these struct redefinitions.  I'm 
> wondering if these structs are defined properly or am I missing some 
> flag when I build?
>
> Here are the actual errors:
>
> c:\axis2c-src-1.1.0\build\deploy\include\platforms\windows\axutil_dir_windows.h(30) 
> : error C2011: 'dirent' :
> 'struct' type redefinition
>         \atria\nt\include\dirent.h(16) : see declaration of 'dirent'
> c:\axis2c-src-1.1.0\build\deploy\include\platforms\windows\axutil_dir_windows.h(48) 
> : error C2371: 'DIR' : red
> efinition; different basic types
>         \atria\nt\include\dirent.h(27) : see declaration of 'DIR'
> c:\axis2c-src-1.1.0\build\deploy\include\platforms\windows\axutil_dir_windows.h(56) 
> : error C2373: 'opendir' :
>  redefinition; different type modifiers
>         \atria\nt\include\dirent.h(29) : see declaration of 'opendir'
> c:\axis2c-src-1.1.0\build\deploy\include\platforms\windows\axutil_dir_windows.h(62) 
> : error C2373: 'closedir'
> : redefinition; different type modifiers
>         \atria\nt\include\dirent.h(32) : see declaration of 'closedir'
> c:\axis2c-src-1.1.0\build\deploy\include\platforms\windows\axutil_dir_windows.h(69) 
> : error C2373: 'readdir' :
>  redefinition; different type modifiers
>         \atria\nt\include\dirent.h(30) : see declaration of 'readdir'
> c:\axis2c-src-1.1.0\build\deploy\include\platforms\windows\axutil_dir_windows.h(80) 
> : error C2556: 'int rewind
> dir(DIR *)' : overloaded function differs only by return type from 
> 'void rewinddir(DIR *)'
>         \atria\nt\include\dirent.h(31) : see declaration of 'rewinddir'
> c:\axis2c-src-1.1.0\build\deploy\include\platforms\windows\axutil_dir_windows.h(80) 
> : error C2373: 'rewinddir'
>  : redefinition; different type modifiers
>         \atria\nt\include\dirent.h(31) : see declaration of 'rewinddir'
>
> Thanks,
> Mike
>
> Michael J Molé
> Software Engineer
> IBM Software Group - Rational
> (781)676-2710 


-- 
Samisa Abeysinghe - Apche Axis2/C
"http://ws.apache.org/axis2/c/?Apache&nbsp;Axis2/C&nbsp;The&nbsp;Web&nbsp;Services&nbsp;Engine"


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org


Re: Axis2C: compile error - 'struct' type redefinition

Posted by Samisa Abeysinghe <sa...@wso2.com>.
Michael Mole wrote:
>
> I am getting some compile errors that I cannot resolve.  I'm wondering 
> if this is a known issue or if I'm doing something wrong.  Here is the 
> scenario:
>
> I have a C++ class that includes <axiom.h>, <axis2_util.h>, and 
> <axis2_stub.h>.
> It also includes sys/types.h
> When I compile it's complaining about these struct redefinitions.  I'm 
> wondering if these structs are defined properly or am I missing some 
> flag when I build?

I am not sure what the exact error is, I am currently on Linux and 
apparently you are using Windows. However, I think if you remove 
sys/types.h include form your file the problem would go away. Please try 
that.

Samisa...
>
> Here are the actual errors:
>
> c:\axis2c-src-1.1.0\build\deploy\include\platforms\windows\axutil_dir_windows.h(30) 
> : error C2011: 'dirent' :
> 'struct' type redefinition
>         \atria\nt\include\dirent.h(16) : see declaration of 'dirent'
> c:\axis2c-src-1.1.0\build\deploy\include\platforms\windows\axutil_dir_windows.h(48) 
> : error C2371: 'DIR' : red
> efinition; different basic types
>         \atria\nt\include\dirent.h(27) : see declaration of 'DIR'
> c:\axis2c-src-1.1.0\build\deploy\include\platforms\windows\axutil_dir_windows.h(56) 
> : error C2373: 'opendir' :
>  redefinition; different type modifiers
>         \atria\nt\include\dirent.h(29) : see declaration of 'opendir'
> c:\axis2c-src-1.1.0\build\deploy\include\platforms\windows\axutil_dir_windows.h(62) 
> : error C2373: 'closedir'
> : redefinition; different type modifiers
>         \atria\nt\include\dirent.h(32) : see declaration of 'closedir'
> c:\axis2c-src-1.1.0\build\deploy\include\platforms\windows\axutil_dir_windows.h(69) 
> : error C2373: 'readdir' :
>  redefinition; different type modifiers
>         \atria\nt\include\dirent.h(30) : see declaration of 'readdir'
> c:\axis2c-src-1.1.0\build\deploy\include\platforms\windows\axutil_dir_windows.h(80) 
> : error C2556: 'int rewind
> dir(DIR *)' : overloaded function differs only by return type from 
> 'void rewinddir(DIR *)'
>         \atria\nt\include\dirent.h(31) : see declaration of 'rewinddir'
> c:\axis2c-src-1.1.0\build\deploy\include\platforms\windows\axutil_dir_windows.h(80) 
> : error C2373: 'rewinddir'
>  : redefinition; different type modifiers
>         \atria\nt\include\dirent.h(31) : see declaration of 'rewinddir'
>
> Thanks,
> Mike
>
> Michael J Molé
> Software Engineer
> IBM Software Group - Rational
> (781)676-2710 


-- 
Samisa Abeysinghe : WSO2 WSF/PHP
"http://wso2.org/projects/wsf/php?WSO2&nbsp;Web&nbsp;Services&nbsp;Framework%2FPHP&nbsp;-&nbsp;Open&nbsp;source&nbsp;PHP&nbsp;extention&nbsp;for&nbsp;providing&nbsp;and&nbsp;consuming&nbsp;Web&nbsp;services&nbsp;in&nbsp;PHP"


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org