Is it possible to organize C ++ and cpp files?

I'm not sure I'm asking the right question, but here.

I have C ++ - a solution with a structure

[folder] Header files -

... 200 header files.

[folder] Source files -

... 200 sura files ..

... rest

Is it possible to organize header and sum files into folders, as in a C # project? The problem I encountered is that as the project grows, it becomes tedious to navigate a huge pile of files, which would be much easier to navigate if they were organized by functionality (for example, folders and namespaces in C # projects) ,.

Is there any standard that will be supported by many compilers, not just Visual Studio?

Example:

[folder] Header files -

  • [folder] X domain
    • 100 header files
  • [folder] Y domain
    • 100 header files

[folder] Source files -

  • [folder] X domain
    • 100 cpp files
  • [folder] Y domain
    • 100 cpp files

... rest

+11
c ++ visual-studio-2012
Sep 10 '12 at 22:09
source share
2 answers

The header / source file is not a requirement of Visual Studio. This is just the default layout, and it is virtual, not physical. If you click "Show all files" in the solution explorer, it will show the folder tree as on the hard drive, and you can manipulate as you like. This is the only normal configuration, and I have no idea why this is. Plus, of course, they fixed it for C # projects, but not C ++.

+39
Sep 10 '12 at 22:16
source share

I do not know the standard, but you can put the header (and source) files in any folder structure that you like.

You need to make sure that the relative path belongs to the linked files or add a folder to the project search path.

0
Sep 10 '12 at 22:24
source share



All Articles