Can't include

前端 未结 2 767
予麋鹿
予麋鹿 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 05:58

    Edit: Obviously Colin Hebert solved the problem, but as a general tip I`d like to say:

    In Camera.h write

    #ifndef _CAMERA_H
    #define _CAMERA_H
    

    above all other includes. And include all header files needed in your .cpp file in your .h file.

    At least that`s what I think is best practice.

提交回复
热议问题