Thread: error: expected ‘)’ before ‘*’ token

  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,909
    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
    583
    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, 10:26 PM
  5. error: expected class-name before ‘{’ token
    By keira in forum C++ Programming
    Replies: 8
    Last Post: 12-21-2007, 06:13 PM