C++ 使用angelscript编译错误

C++ 使用angelscript编译错误,c++,angelscript,C++,Angelscript,我试图使用GCC4.7.1使用angelscript 2.25.1 我编译了一个没有问题的脚本 但是,当我尝试编译使用angelscript的项目时,我遇到以下错误: jarrett@jarrett-g74s:~/projects/myproject$ scons scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... g++ -o build/co

我试图使用GCC4.7.1使用angelscript 2.25.1

我编译了一个没有问题的脚本

但是,当我尝试编译使用angelscript的项目时,我遇到以下错误:

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.
所以基本上,它(我猜编译器)在
asIScriptModule
中找不到
GetFunctionIdByDecl
函数。我很确定它应该在那里

此外,lin 242上的代码为:

int funcId = mod->GetFunctionIdByDecl(function);
其中,
函数
在前面声明为
char*
mod
类型为
asIScriptModule*mod


我认为这可能是gcc 4.7.1的一个问题……但我不确定。

感谢@chris的回答

根据源代码(angelscript.h第664行),getFunctionIDByeCl 已弃用,因此您需要将其定义为弃用


感谢@chris的回答

根据源代码(angelscript.h第664行),getFunctionIDByeCl 已弃用,因此您需要将其定义为弃用


根据源代码(angelscript.h第664行),
getfunctionidbyecl
已弃用,因此您需要
#定义为_弃用
才能使用它。ahhh..hmm。谢谢chris…我会给它一个gowelp,它做到了-我只是查看了api,现在找到了正确的方法。谢谢@chris!如果你把你的解决方案作为一个答案,我会把它标记为已解决(这样你就得到了业力)。Cheers根据源代码(angelscript.h第664行),
GetFunctionIdByDecl
已弃用,因此您需要
#定义为_弃用
才能使用它。ahhh..hmm。谢谢chris…我会给它一个gowelp,它做到了-我只是查看了api,现在找到了正确的方法。谢谢@chris!如果你把你的解决方案作为一个答案,我会把它标记为已解决(这样你就得到了业力)。干杯