schauma
schauma

Reputation: 3

Visual Studio Folders in Project

I am currently trying to work myself into Visual Studio 2019. What I want is a clean structure between header and source files. My current project in the Solution Explorer looks like this:

--...
--References
--External Dependencies
--main.cpp
--Dummy.cpp
--Dummy.h
--...

What I want is a structure seen best in this picture

--...
--References
--External Dependencies
--Header Files
---->Dummy.h
---->...
--Source Files
---->main.cpp
---->Dummy.cpp
---->...
--...

I don't know what this Function/Option needed here is called so searching this issue is not easy.

In most tutorials etc. I can find this kind of structure is set up automatically when they create a new solution/project. But not for me.

What is this I am looking for called? Can you point me to a source where I can read up on how to set this kind of thing up? Or even easier can you tell me how it's done?

Upvotes: 0

Views: 52

Answers (1)

Landstalker
Landstalker

Reputation: 1368

You can create folders in your project:

enter image description here

Create two folders named Header_Files and Source_Files:

enter image description here

Now you must set the extension filter:

enter image description here

That means: .h files will be systematically assigned to the folder Header_Files
Do the same thing with Source_Files by adding filter cpp;cxx;c;... which allows VS to assign systematically .cpp;cxx;c;... files to Source_Files

Upvotes: 1

Related Questions