我收到此错误:
Expected '(' for function-style cast or type construction
在第二行:
struct OpenALInterface * CreateOpenALInterface(int numLoadedSounds, int numPlayingSounds){
return new IOS_OpenAL(int numLoadedSounds, int numPlayingSounds); //ERROR ABOVE
// return new IOS_OpenAL(); //this works fine, no error
};
类有这个:
class IOS_OpenAL: public OpenALInterface{
public:
IOS_OpenAL(int numLoadedSounds, int numPlayingSounds){
//do stuff
};
// IOS_OpenAL(){}; //works
这个错误到底指的是什么?它看起来像一个语法错误。
基类是抽象的,没有构造函数。是这个问题吗?子类可以覆盖或拥有自己的构造函数不在基类中吗?