Sign in to follow this  

'extern' not allowed after class or struct

Recommended Posts

I am trying to compile a library with a mingw compiler (from DevC++) and get the following error: "storage class specifier `extern' not allowed after struct or class" The line reads like this:
class LUAPLUS_CLASS LuaObject

with LUAPLUS_CLASS being defined like this:
    #ifndef LUA_API
        #define LUA_API extern
    #ifndef LUAPLUS_CLASS
        #define LUAPLUS_CLASS LUA_API

Well,... it is obvious, that the compiler doesn't like a "class extern LuaObject", but what am I supposed to do now? Regards, T.

Share this post

Link to post
Share on other sites
You don't extern a class, you extern variables.
// variable declaration
extern int i;

// class declaration
class SomeClass;

// variable definition
int i;

// class definition
class SomeClass
// member & static functions & variables


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this