Why do I get the error “error: unknown type name 'virtual'” when trying to compile this code?

后端 未结 7 2472
庸人自扰
庸人自扰 2021-02-14 01:41

Code:

struct IRenderingEngine {
    virtual void Initialize(int width, int height) = 0;
    virtual void Render() const = 0;
    virtual void UpdateAnimation(flo         


        
7条回答
  •  情书的邮戳
    2021-02-14 01:55

    This is just a stupid guess since I've never tried compiling something with the word virtual in a C compiler... but is there any chance that you were trying to compile this C++ code as C code? That's the only reason I can think of that a compiler wouldn't understand the keyword virtual.

提交回复
热议问题