VC++ compile errors when including gl.h

后端 未结 4 1722
自闭症患者
自闭症患者 2021-02-04 01:05

Compiling a file that uses OpenGL with Visual C++, when I try to include the gl.h header file I get about 150 unhelpful compile errors:

error C2144: syntax error : \'voi

4条回答
  •  無奈伤痛
    2021-02-04 01:20

    The first possibility to consider is that the compiler's messages are actually right. Surely there were line numbers included in those error messages, so have you looked at the offending lines, and some of the lines preceding them, to try to identify what might really be the cause?

    Were there any other messages that came before the ones you've cited? (A missing header, for instance?) Always start addressing compiler messages from the first one; later ones are sometimes just side effects caused by that.

    Can you reproduce the problem in a simple project? Is it enough to just write #include in an otherwise empty file and try to compile it? Or is there more about this source code that causes the error to occur?

    Remember that you're the one here with access to your code; the questions I'm asking above are the sorts of things you need to consider since you can't always have someone else debug your code for you.

提交回复
热议问题