[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

C++ compilation problem

I'm trying to port some software to the axis board.  It successfully
compiles under the
host platform, however I get the following error when compiling it with

gcc_cris -melinux -xc++ -muclibc=/home/matthewh/axis/devboard_lx/eroot
-Wall -O2
 -DELINUX -Wno-ctor-dtor-privacy -ansi -pipe -fcheck-new -Wall  -Istl
-Icommon -
IPPP -Ibcsp -Ibluetooth -D_RDSDEBUG -Dlinux    -c -o BluetoothBridge.o
In file included from
                 from BridgeState.h:37,
                 from BridgeStateInitial.h:16,
                 from BluetoothBridge.cpp:2:
/home/matthewh/axis/devboard_lx/eroot/include/uC-libc/bits/in.h:69: ISO C++
ids data member
`ip_opts' wi
th same name as
enclosing cl
make: *** [BluetoothBridge.o] Error 1

It seems to be complaining about the following structure in in.h

/* Structure used to describe IP options for IP_OPTIONS. The `ip_dst'
   field is used for the first-hop gateway when using a source route
   (this gets put into the header proper).  */
struct ip_opts
    struct in_addr ip_dst;      /* First hop; zero without source route.
    char ip_opts[40];           /* Actually variable in size.  */

I think because C++ thinks that ip_opts is the name of the structure as
structures and classes are
almost the same.  However in C ip_opts is not the name of the structure it
is actually "struct ip_opts".

How can I get around this ?