开发者

C++ Project Structure

开发者 https://www.devze.com 2023-01-11 07:58 出处:网络
I\'m now involved with a C++ project, and I\'ve never developed开发者_如何学C in C++ before.The question I have is the structure of projects that are multi-platform.One developer is working in VC++ an

I'm now involved with a C++ project, and I've never developed开发者_如何学C in C++ before. The question I have is the structure of projects that are multi-platform. One developer is working in VC++ and another in XCode. XCode doesn't have literal directories, they're logical (groups) directories. Should big C++ projects have actual folders, and if so, how can there be cross platform support for projects running in different development environments?

So if a folder is created in VC++, is it an actual folder, or is it just a grouping for VC++ the same as XCode? If this is a problem, how do you create actual folders in XCode?

Cheers


Visual Studio will place all files in the project folder by default. It has 'filters' which I think are equivalent to XCode's groups; they're sort of like folders within the project, used to group files together, but not actual directories on the file system.

Note the difference between your project and solution. Each project builds a different binary, while the solution just groups together the projects. When you create a new project, it will be given a new directory in the solution folder, unless you provide it a path. And then you have filters within the projects, which are just used for grouping and have no effect on your files' location in the file system.


The simplest way is using an abstraction layer on top of that. I have used CMake before, where you define how your project is (project in the general sense, not in the VS Project) where to find each source file, headers, libraries to link... then you can generate VS solutions, or Xcode projects, Eclipse CDT projects, Makefiles... you name it.

0

精彩评论

暂无评论...
验证码 换一张
取 消