我知道头文件如何在c ++中工作的机制,但我只是开始用大量的类编写更大的opengl程序,我想知道是否有一个"标准"或传统的方法来组织更大的程序围绕头文件或如果它在大多数情况下只是个人偏好?
1. Divide your project into Modules. 2. Make a directory for each module. 3. Under each directory for a module create 2 sub directories inc/ and src/ where you will place your header and source files resp. 4. Create a global directory and place your header and cpp files in that directory which would be used commonly by several modules. 5. Make your Makefile that includes path and links to all libraries correctly.
这就是我所遵循的.可能还有其他更高效,效率更低的方式:)