structure inside structure - c++ Error

Posted by gamadeus on Stack Overflow See other posts from Stack Overflow or by gamadeus
Published on 2011-02-18T11:10:05Z Indexed on 2011/02/20 15:25 UTC
Read the original article Hit count: 322

Filed under:
|
|
|
|

First of all the error I am getting is of the type:

Request for member 's' of struct1.struct1::struct2, which is of non class type '__u32'

where:

struct struct1 {

struct x struct2;
struct x struct3;
struct x struct4;
};

The usage is of the form:

struct struct1 st1;
st1.struct2.s = Value;

Now my struct1 is:

struct ip_mreq_source {
  struct in_addr imr_multiaddr;
  struct in_addr imr_sourceaddr;
  struct in_addr imr_interface;
};

struct 'x' is in_addr Where:

typedef uint32_t in_addr_t;
struct in_addr
  {
    in_addr_t s_addr;
  };

element 's' is the element s_addr in in_addr.

My detailed error coming out of g++ (GCC 4.4.3) from the Android based compiler:

    arm-linux-androideabi-g++ -MMD -MP -MF groupsock/GroupsockHelper.o.d.org -fpic
 -ffunction-sections -funwind-tables -fstack-protector -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ 
-D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__  -Wno-psabi -march=armv5te -mtune=xscale -msoft-float 
-fno-exceptions -fno-rtti -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -finline-
limit=64 -Igroupsock/include -Igroupsock/../UsageEnvironment/include -Iandroid-
ndk-r5b/sources/cxx-stl/system/include -Igroupsock -DANDROID  -Wa,--noexecstack 
-DANDROID_NDK -Wall -fexceptions  -O2 -DNDEBUG -g   -Iandroid-8/arch-arm/usr/include -c  
groupsock/GroupsockHelper.cpp -o groupsock/GroupsockHelper.o && rm -f 
groupsock/GroupsockHelper.o.d && mv groupsock/GroupsockHelper.o.d.org 
groupsock/GroupsockHelper.o.d
groupsock/GroupsockHelper.cpp: In function 'Boolean socketJoinGroupSSM(UsageEnvironment&, int, netAddressBits, netAddressBits)':
groupsock/GroupsockHelper.cpp:427: error: request for member 's_addr' in 'imr.ip_mreq_source::imr_multiaddr', which is of non-class type '__u32'
groupsock/GroupsockHelper.cpp:428: error: request for member 's_addr' in 'imr.ip_mreq_source::imr_sourceaddr', which is of non-class type '__u32'
groupsock/GroupsockHelper.cpp:429: error: request for member 's_addr' in 'imr.ip_mreq_source::imr_interface', which is of non-class type '__u32'

I am not sure what is causing the error. Any pointers would be great - no pun intended. Thanks

© Stack Overflow or respective owner

Related posts about c++

Related posts about android