• Advertisement
Sign in to follow this  

using angelscript compile error

This topic is 1897 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all,

I'm trying to use angelscript 2.25.1 using gcc 4.7.1

I compiled angelscript without issues.

When I try to compile my project that uses angelscript, however, I'm getting this error:

jarrett@jarrett-g74s:~/projects/myproject$ scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
g++ -o build/common/as_wrapper/AngelScript.o -c -I"../lwis/src/engine" -I"../ice_engine/src/engine" src/common/as_wrapper/AngelScript.cpp
src/common/as_wrapper/AngelScript.cpp: In member function ‘void as_wrapper::AngelScript::loadScripts()’:
src/common/as_wrapper/AngelScript.cpp:85:33: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
src/common/as_wrapper/AngelScript.cpp:87:30: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
src/common/as_wrapper/AngelScript.cpp:88:31: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
src/common/as_wrapper/AngelScript.cpp: In member function ‘int as_wrapper::AngelScript::initContext(char*, char*)’:
src/common/as_wrapper/AngelScript.cpp:242:20: error: ‘class asIScriptModule’ has no member named ‘GetFunctionIdByDecl’
src/common/as_wrapper/AngelScript.cpp:258:22: error: invalid conversion from ‘int’ to ‘asIScriptFunction*’ [-fpermissive]
In file included from src/common/as_wrapper/AngelScript.h:11:0,
from src/common/as_wrapper/AngelScript.cpp:8:
/usr/local/include/angelscript/angelscript.h:734:26: error: initializing argument 1 of ‘virtual int asIScriptContext::Prepare(asIScriptFunction*)’ [-fpermissive]
scons: *** [build/common/as_wrapper/AngelScript.o] Error 1
scons: building terminated because of errors.

So basically, it (I guess the compiler) can't find GetFunctionIdByDecl function in asIScriptModule. I'm pretyt sure it should be there though.

Also, the code on lin 242 is:
int funcId = mod->GetFunctionIdByDecl(function);
where 'function' is declared earlier as a 'char*' and 'mod' is of type 'asIScriptModule *mod'.

I thought this might be an issue with gcc 4.7.1....but I'm not sure.

Does anyone have any ideas?

I appreciate any help! smile.png



Share this post

Link to post
Share on other sites
Apparently, that method is now deprecated.

Found out from Chris on stackoverflow (here: http://stackoverflow.com/questions/13370774/using-angelscript-compile-error)

According to the source (angelscript.h line 664), GetFunctionIdByDecl is deprecated, so you need to #define AS_DEPRECATED to use it[/quote]

Share this post

Link to post
Share on other sites
The manual is also a good place to look for information like this :)

Or if you're upgrading from an older version and the deprecated functions have already been removed and thus not mentioned in the manual, then the change list will help you understand what has been modified over the various versions. The section 'Library interface' is specifically for giving this type of information.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement