×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Dec 2003
    Posts
    5

    extern "C" gives "Illegal Empty Declaration error"

    Hi.

    I was wondering if anyone here has any prior encounters with an "illegal empty declaration" error that occurs when using [extern "C"]. I am developing on carbide C++ 1.1 with S60 3rd edition SDK supporting Feature Pack 1.

    My file is as shown below:

    ---start mytypes.h---

    #ifndef MYTYPES_H
    #define MYTYPES_H

    #include <e32def.h>

    #ifdef __cplusplus
    extern "C" {
    #endif


    typedef TInt8 myInt8
    typedef TBool myBool
    ...etc...
    ...etc...


    #ifdef __cplusplus
    }; <--- throws illegal empty declaration here
    #endif

    #endif

    ---end mytypes.h---

    The file is fairly straight-forward and yet, I get this error.
    Am I doing something wrong?

  2. #2
    (Retired) Nokia Developer Admin.
    Join Date
    Jan 2006
    Location
    Michigan
    Posts
    4,664

    Re: extern "C" gives "Illegal Empty Declaration error"

    Code:
    #ifdef __cplusplus
    }; <--- throws illegal empty declaration here
    #endif
    that is because it is an empty declaration try this without the semicolon

    Code:
    #ifdef __cplusplus
    }
    #endif
    Ron

Similar Threads

  1. carbide build problem help please
    By berkcekisbas in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2006-09-26, 19:41
  2. can not successfully link any sample using .NET
    By lobotomat in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2002-08-20, 00:29

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×