gpt4 book ai didi

c++ - 使用angelscript编译报错

转载 作者:太空宇宙 更新时间:2023-11-04 12:02:56 25 4
gpt4 key购买 nike

我正在尝试使用 gcc 4.7.1 使用 angelscript 2.25.1

我毫无问题地编译了 angelscript。

但是,当我尝试编译使用 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);

其中 function 之前声明为 char* 并且 mod 的类型为 asIScriptModule *mod

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

最佳答案

感谢@chris 的回答。

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

关于c++ - 使用angelscript编译报错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13370774/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com