错误'函数调用缺失...'帮助 [英] Error 'function call missing...' Help
问题描述
Hellow,我正在升级游戏引擎,但我收到错误
我不知道如何解决它
错误代码:
'
1> ------构建开始:项目:hl,配置:调试Win32 ------
1 GT; gonome.cpp
1> d:\ src_dll \ divs \ artome.cpp(115):错误C3867:'CGonomeSpit :: Animate':函数调用缺少参数列表;使用'& CGonomeSpit :: Animate'创建指向成员的指针
1> d:\ src_dll \dlls\gonome.cpp(164):错误C3867:'CBaseEntity :: SUB_Remove ':函数调用缺少参数列表;使用'& CBaseEntity :: SUB_Remove'创建指向成员的指针
==========构建:0成功,1失败,0到达 - date,0跳过==========
'
源代码:
Hellow, I am upgrading a game engine, but I get errors
I dont know how to fix it
Error Code:
'
1>------ Build started: Project: hl, Configuration: Debug Win32 ------
1> gonome.cpp
1>d:\src_dll\dlls\gonome.cpp(115): error C3867: 'CGonomeSpit::Animate': function call missing argument list; use '&CGonomeSpit::Animate' to create a pointer to member
1>d:\src_dll\dlls\gonome.cpp(164): error C3867: 'CBaseEntity::SUB_Remove': function call missing argument list; use '&CBaseEntity::SUB_Remove' to create a pointer to member
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
'
Source Code:
void CGonomeSpit::Animate( void )
{
pev->nextthink = gpGlobals->time + 0.1;
if ( pev->frame++ )
{
if ( pev->frame > m_maxFrame )
{
pev->frame = 0;
}
}
}
//=========================================================
// Gonome's spit projectile
//=========================================================
class CGonomeSpit : public CBaseEntity
{
public:
void Spawn( void );
static void Shoot( entvars_t *pevOwner, Vector vecStart, Vector vecVelocity );
void Touch( CBaseEntity *pOther );
void EXPORT Animate( void );
virtual int Save( CSave &save );
virtual int Restore( CRestore &restore );
static TYPEDESCRIPTION m_SaveData[];
int m_maxFrame;
};
我不知道修改代码
请帮帮我
I have no idea to fix the code
Please help me
推荐答案
旧版编译器和新编译器之间有一点区别:
There is a little difference between the older compiler and the newer:
void mycallback()
{
}
void worker(void (*fn)())
{
(*fn)();
}
void main()
{
// accepted only by devstudio 6 and lower
worker(mycallback); // old compiler makes an implicit cast to a function call
// function parameter for new devstudio
worker(&mycallback); // new compiler needs an explicit cast to a function call
}
问候。
Regards.
你可能还有一些东西错误之前就像错过了}这会导致编译器尝试编译代码,就像它在函数内部一样。
You might also have somthing wrong before that like a missing } which would cause the compiler to try to compile the code as if it was inside a function.
If(a< i)
{
Printf(%d,标记值);
}
If(a<i)
{
Printf("%d", marks value) ;
}
这篇关于错误'函数调用缺失...'帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!