1

您将如何组织您的 vc 项目源代码以共享相同的头文件?

  1. 将标题放在一个公共文件夹中,并让每个 vc 项目都包含它。
  2. 将标头放在 vc 项目中,并让其他项目将其作为链接包含在内。
  3. 将头文件复制到每个vc项目中

有更好的解决方案吗?

4

1 回答 1

1

To my mind, option 1 is preferable.

Option 2 sounds a little VC-specific and I'm not sure I'd do things that way.

The worst "smelling" option is option 3, at least the way you've presented it.

Before deciding, though, you should consider what version control system you're using. Some allow mapping of a singular file in the repository to several different places on the hard drive. We use this technique to enforce a "contract" (interface) between an Linux system and our Windows main application.

That way, all vc projects have "a copy in very project" but the source of each copy is a single file in the repository.

于 2009-11-13T02:58:02.467 回答