Understanding VC++ project/solution explorer file hierarchy

389 views Asked by At

I took a C++ project done by someone in VC++ and I opened the project on my machine. When I opened the project in VC++, I could see the source files organised in directories: Presenter, View and some file directly under Source Files. These presenter and view directories are seen only in the VC++ project explorer and not in windows file explorer. So I have this basic function: How does VC++ organise the source files in the given project. Also some of my source files are not visible in the VC++ solution explorer while they are seen on the windows file explorer. What could be reason behind that? (While building the code, I get some linking errors due to the functions implemented in these missing .cpp files)

2

There are 2 answers

0
PythonJin On BEST ANSWER

Yes, as it turns out the organization of source files in Visual Studio is not synced, mirrored, or reflected in the Windows file explorer. If you go to the Solution Explorer pane and try to add a new folder (Add -> New Solution Folder) you'll notice that it's a new "Solution Folder" that you're adding, not a new folder on the OS. If you have files that you want to add, you'll also have to explicitly right-click and select Add -> Existing Item..., or as dvasanth suggested, you can edit the *.vcxproj file.

1
dvasanth On

You can directly edit the .vcxproj file to add or remove files & change the project settings. This file is organized in XML format & fairly easy to understand.