YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

New Topic Post Reply
Error when compiling DXSquirrel example
Borgleader
#1 Posted : Friday, November 25, 2011 10:20:07 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/25/2011(UTC)
Posts: 2

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
Earlier today I downloaded the DXSquirrel example on this site but when I tried to compile it I got the following error:
Code:
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

It appears on lines where _BEGIN_CLASS(aclassname) is used.

Any ideas?
fagiano
#2 Posted : Saturday, November 26, 2011 5:26:20 PM(UTC)
Rank: Advanced Member

Groups: Registered, Administrators
Joined: 6/11/2005(UTC)
Posts: 1,056

Thanks: 0 times
Was thanked: 78 time(s) in 60 post(s)
I a macro is missing a return type in a function declaration, put an "int" in the macro that declaraes a function.
Code:

#define _BEGIN_CLASS(classname)  \
        __##classname##__typeof(HSQUIRRELVM v) \
        { \
            sq_pushstring(v,_T(#classname),-1); \
            return 1; \
        } \
        struct ScriptClassMemberDecl __##classname##_members[] = { \
        {_T("_typeof"),__##classname##__typeof,1,NULL},


Should be

Code:

#define _BEGIN_CLASS(classname)  \
        int __##classname##__typeof(HSQUIRRELVM v) \
        { \
            sq_pushstring(v,_T(#classname),-1); \
            return 1; \
        } \
        struct ScriptClassMemberDecl __##classname##_members[] = { \
        {_T("_typeof"),__##classname##__typeof,1,NULL},


Alberto
Follow me on Twitter @squirrellang
Borgleader
#3 Posted : Saturday, November 26, 2011 5:48:54 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/25/2011(UTC)
Posts: 2

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
Wonderful that fixed it! Thank you.
Quick Reply Show Quick Reply
Users browsing this topic
Guest
New Topic Post Reply
Forum Jump  
You can post new topics in this forum.
You can reply to topics in this forum.
You can delete your posts in this forum.
You can edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.

Clean Slate theme by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.4 | YAF © 2003-2010, Yet Another Forum.NET
This page was generated in 0.133 seconds.