Thread: Problem with include file.

  1. #1
    Registered User
    Join Date
    Feb 2003
    Posts
    175

    Problem with include file.

    I am adding new .c file to existing project consisting of few .c file and few .h files. The existing project builds properly.( BC++ 4.0)

    But when I include one of the existing .h file in my new .c file, I get error, "Declaration Syntax error."

    I get error on following lines of existing .h file.
    extern BOOL k1;
    extern BOOL f1;

    extern BOOL foo1(char ID, char *p);
    extern BOOL foo2(char ID, char *p);
    extern BYTE foo3(char ID, char mark);

    I strongly feel that the problem is with BOOL and BYTE typedefs.

    BOOL has been typdefed in one of the .h file, provided by envirnment file( NOT BC include file) and BYTE has typdefed in another user .h file of same project.

    Any help will be highly appreciated.

    Thx.

  2. #2
    Green Member Cshot's Avatar
    Join Date
    Jun 2002
    Posts
    892
    Did you include the correct header files? Are your header files guarded?

    For example, you would have a header file named foo.h:

    Code:
    #ifndef FOO_H
    #define FOO_H
    
    // your header file contents here
    
    #endif
    Try not.
    Do or do not.
    There is no try.

    - Master Yoda

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Newbie homework help
    By fossage in forum C Programming
    Replies: 3
    Last Post: 04-30-2009, 04:27 PM
  2. To find the memory leaks without using any tools
    By asadullah in forum C Programming
    Replies: 2
    Last Post: 05-12-2008, 07:54 AM
  3. help with text input
    By Alphawaves in forum C Programming
    Replies: 8
    Last Post: 04-08-2007, 04:54 PM
  4. Post...
    By maxorator in forum C++ Programming
    Replies: 12
    Last Post: 10-11-2005, 08:39 AM
  5. multiple file loading. so fruturated! help!
    By psychopath in forum Game Programming
    Replies: 5
    Last Post: 05-09-2005, 05:13 PM