Error message in .h file

This is a discussion on Error message in .h file within the C Programming forums, part of the General Programming Boards category; Here is a piece of code from my lib.h file: Code: typedef struct list List; extern List *insertList (char *head, ...

  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    1

    Error message in .h file

    Here is a piece of code from my lib.h file:

    Code:
    typedef struct list List;
    
    extern List *insertList (char *head, List *tail);
    extern List *makeList (FILE *fp);
    extern void printList (List *aList);
    extern List *nospaceList (List *h);
    extern void *wordCompare (List *aList, char *word);
    This worked when I compiled it with gcc in linux. However, when i compiled the same code in Pelles C for windows, it came out with the following errors:
    error #2001: Syntax error; found '*' expecting ')'
    and
    Extraneous old-style parameter list


    these error messages are both for the line, extern List *makeList (FILE *fp);

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,546
    Has stdio.h been included yet - either earlier in lib.h, or before lib.h was included ?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. File being filled with NULLs
    By Tigers! in forum Windows Programming
    Replies: 2
    Last Post: 06-30-2009, 05:28 PM
  2. Newbie homework help
    By fossage in forum C Programming
    Replies: 3
    Last Post: 04-30-2009, 04:27 PM
  3. sequential file program
    By needhelpbad in forum C Programming
    Replies: 80
    Last Post: 06-08-2008, 01:04 PM
  4. Making a LIB file from a DEF file for a DLL
    By JMPACS in forum C++ Programming
    Replies: 0
    Last Post: 08-02-2003, 08:19 PM
  5. System
    By drdroid in forum C++ Programming
    Replies: 3
    Last Post: 06-28-2002, 10:12 PM

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