• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Import existing source file structure into Visual Studio

Leros

Lifer
I have an existing C++ project that is nicely organized by directories. Most IDEs use this directory structure in their project browser, but Visual Studio users what it calls filters, which don't seem to relate to directory structure.

When I import the project into Visual Studio, it just puts all the files into one flat filter (all cpp files in "Source Files" and all h files "Header Files").

I can manually add filters to mimic the directory structure, but this takes time and is quite tedious. Is there a way to do this automatically?
 
Create empty project -> Nuke the 3 created folders.

Throw your nicely laid out source tree in the project folder.
Click "Show all files."

Right click folder(s) => Add to project.

At least that's what google said.
 
Last edited:
Create empty project -> Nuke the 3 created folders.

Throw your nicely laid out source tree in the project folder.
Click "Show all files."

Right click folder(s) => Add to project.

At least that's what google said.

That's what I did. It added them as a flat structure.
 
If you goto the top of the Solution Explorer there's a button that says 'Show All Files'.

Toggling that gets rid of the Source/Headers filters and shows you the directory structure.
 
If you use the Solution Explorer to add folders then they should come in exactly as they are on disk... You have to use the "Include in project" option.

If you use the File menu, or you right-click the project and choose Add existing... or anything of the sort, then you won't get the folder structure on disk.
 
Back
Top