Can't include

前端 未结 2 765
予麋鹿
予麋鹿 2021-02-19 05:22

I\'m using Visual Studio 2010. I\'m trying to write simple Camera class in OpenGL. I need to include gl/gl.h in Camera.h
gl/gl.h is already included in main.cpp and Camera.h

2条回答
  •  遇见更好的自我
    2021-02-19 06:00

    Just do an include of windows.h first.

    #include 
    

    As it's said in the OpenGL FAQ :

    Also, note that you'll need to put an #include statement before the #include. Microsoft requires system DLLs to use a specific calling convention that isn't the default calling convention for most Win32 C compilers, so they've annotated the OpenGL calls in gl.h with some macros that expand to nonstandard C syntax. This causes Microsoft's C compilers to use the system calling convention. One of the include files included by windows.h defines the macros.


    Resources :

    • social.msdn.microsoft.com - OpenGL problems
    • OpenGL FAQ - Why am I getting compile, link, and runtime errors?

提交回复
热议问题