views:

129

answers:

2

I'm now involved with a C++ project, and I've never developed 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

+1  A: 

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.

dauphic
Is this the default behaviour? So if you create a "folder" it's actually just a filter where files are grouped?
Kezzer
Yes, Visual Studio calls it a filter, but the icon is a folder.
dauphic
okay, just need to confirm in a mo' then will mark as correct
Kezzer
+1  A: 

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.

David Rodríguez - dribeas