error: expected ‘)’ before ‘*’ token

This is a discussion on error: expected ‘)’ before ‘*’ token within the C Programming forums, part of the General Programming Boards category; Why is it when I compile the following line: extern bool_t xdr_RAP_BYTE_TYPE (XDR *, RAP_BYTE_TYPE*); gives me the error: rap.h:307:49: ...

  1. #1
    Registered User
    Join Date
    Jan 2012
    Posts
    59

    error: expected ‘)’ before ‘*’ token

    Why is it when I compile the following line:

    extern bool_t xdr_RAP_BYTE_TYPE (XDR *, RAP_BYTE_TYPE*);

    gives me the error:

    rap.h:307:49: error: expected ‘)’ before ‘*’ token

  2. #2
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,438
    You're probably missing a header file that defines XDR or RAP_BYTE_TYPE, or they're defined below that prototype.

  3. #3
    Registered User
    Join Date
    Mar 2010
    Posts
    535
    Does the compiler know what bool_t, XDR and RAP_BYTE_TYPE are at this point in the code? If they are defined in another header, headers included in an order such that these types have been defined before this point?

    If that's not the problem, could you provide some more code please?

  4. #4
    Registered User
    Join Date
    Jan 2012
    Posts
    59
    Ah ha! XDR is not being defined anywhere.

  5. #5
    Registered User
    Join Date
    Jan 2012
    Posts
    59
    Turns out Cygwin did not come with an XDR library. Found one and included it and it turns out I could just eliminate the xdr calls all together.
    But you guys were right and thanks.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Error: expected identifier or ‘(’ before ‘{’ token
    By jpcanaverde in forum C Programming
    Replies: 66
    Last Post: 06-08-2010, 12:53 PM
  2. error: expected unqualified-id before '=' token
    By (::) in forum C++ Programming
    Replies: 2
    Last Post: 05-16-2008, 11:50 PM
  3. Replies: 2
    Last Post: 04-26-2008, 04:43 AM
  4. error: expected ‘;’ before ‘:’ token
    By kris.c in forum C Programming
    Replies: 5
    Last Post: 02-10-2008, 09:26 PM
  5. error: expected class-name before ‘{’ token
    By keira in forum C++ Programming
    Replies: 8
    Last Post: 12-21-2007, 05:13 PM

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