C ++ project structure in Visual Studio 2008

So, I have been doing Java for several years, but now I am starting a C ++ project. I am trying to identify best practices for creating a specified project.

Within a project, how do you usually structure your code? Are you doing this in a Java style with namespace folders and splitting your source this way? Do you maintain public headers in the include directory to facilitate links?

I saw both and other ways, but what is a good method for a large project?

Also, how do you deal with resources / folders in the application structure? All this is good and useful for the final project for installation with a folder logfor storing logs, possibly in a folder libfor library files, perhaps in a folder datafor data, but how do you control these bits in a project? Is there a way to determine that when building a solution, it builds a structure for you? Or do you just need to go into your built-in configuration folders (Debug, Release, etc.) and create the file structure manually, thereby ensuring the correct location of the paths that your EXE file expects?

+3
source share
2 answers

, ( ) . .

, :

//depot/MyProject/ASubSystem/AComponentOfTheSubSystem/ASubComponentWithAVSSolution

Visual Studio:

//depot/MyProject/ASubSystem/AComponentOfTheSubSystem/ASubComponentWithAVSSolution/Something
//depot/MyProject/ASubSystem/AComponentOfTheSubSystem/ASubComponentWithAVSSolution/SomethingElse
//depot/MyProject/ASubSystem/AComponentOfTheSubSystem/ASubComponentWithAVSSolution/TestTheSolution

, /. "" .

, .

"include". Visual Studio . "Release", .

+1

, , . nmake, : Scons, Bakefile, nmake, Ant, vcproj

, "" DLL. , , .

IDE - :

/solution
   /prj1
      /headers
        /module1
        /module2
      /resource
      /source
        /module 1
        /module 2
      /test
   /prj2
      /headers
        /module1
        /module2
      /resource
      /source
        /module 1
        /module 2
      /test

- :

/solution
    /prj1
       /bin
       /build
       /include
          /module1
          /module2
       /lib
       /res
       /src
          /module1
          /module2
       /test
    /prj2
       /bin
       /build
       /include
          /module1
          /module2
       /lib
       /res
       /src
          /module1
          /module2
       /test
+1

Source: https://habr.com/ru/post/1699190/


All Articles