[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
cris

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
Bluetooth
Bridge.cpp
In file included from
/home/matthewh/axis/devboard_lx/eroot/include/uC-libc/neti
net/in.h:227,
                 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++
forb
ids data member
/home/matthewh/axis/devboard_lx/eroot/include/uC-libc/bits/in.h:69:
`ip_opts' wi
th same name as
/home/matthewh/axis/devboard_lx/eroot/include/uC-libc/bits/in.h:69:
enclosing cl
ass
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 ?

Matt