Error: structure XX has no member named YY

This is a discussion on Error: structure XX has no member named YY within the C Programming forums, part of the General Programming Boards category; Hi all, I have the following scenario: Code: typedef struct { u8 member_a; u32 member_d; u32 member_c; u16 member_d; } ...

  1. #1
    Registered User
    Join Date
    Jun 2009
    Posts
    26

    Question Error: structure XX has no member named YY

    Hi all,

    I have the following scenario:

    Code:
    typedef struct {
    	u8	member_a;
    	u32	member_d;
    	u32	member_c;
    	u16	member_d;
    } __attribute__((packed)) fourmembers;
    
    fourmembers *limp = (fourmembers*)0x1000000;
    When I am trying to write into "member_a" of the "fourmembers" structure that "limp" is pointing to like that...

    Code:
    limp->member_a = 0x20;
    ...I am getting the following error:

    Code:
    error: 'fourmembers' has no member named 'member_a'
    Any help will be much appreciated!

    Regards

  2. #2
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    the problem is most likely that your line...
    Code:
    fourmembers *limp = (fourmembers*)0x1000000;
    ...is failing so that limp never gets defined.

    Exactly what are you trying to do with that anyway?

  3. #3
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,158
    Is that the only error you get? Where are those u8, u16, u32 types defined? Is this Linux kernel stuff?
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem defining structure
    By MTK in forum C Programming
    Replies: 12
    Last Post: 09-08-2009, 03:26 PM
  2. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  3. Replies: 2
    Last Post: 04-22-2008, 12:07 PM
  4. Replies: 2
    Last Post: 04-19-2008, 12:06 AM
  5. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21