c++ - 常规的c++程序头文件结构?

标签 c++ file header

我知道头文件如何在 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.

这就是我所遵循的。可能还有其他效率更高和效率更低的方法:)

关于c++ - 常规的c++程序头文件结构?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7592145/

相关文章:

c++ - Boost 1.53 本地日期时间编译器错误 -std=c++0x

c++ - std::vector 已知序列

c - 读取二进制文件 c

golang 文件上传失败

c - LNK2005 在 .c 文件中包含 .h 文件时发生

c++ - QSortFilterProxyModel 没有中继 dataChanged 信号

c++ - gluTessCallback 指向回调函数的指针。编译错误

c++ - 如何使用 C++ 从特定文件中提取 X.509 证书(DER 编码)?

c++ - 如何在 QT Creator 中自动包含所需的标题

c++ - Visual Studio 在哪里寻找 C++ 头文件?