How to create a folder in Visual Studio C++ 2012

后端 未结 2 1454
南旧
南旧 2021-02-19 00:42

I have started my first bigger project with Visual Studio 2012 in C++. I will structure my Source-files in folders, but I can not find where I can create real folders, like in t

2条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-19 01:10

    This is mildly annoying, however, here is what can be done:

    Create the new folder in Visual Studio. This does not create a new folder in the file system. Add a new item to the folder. Choose the proper directory for the item.

    For example, if your project is at %Documents%\Project, and your new folder name is Folder, then you add a new item to that folder at %Documents%\Project\Folder.

    Visual Studio 2012 will put the item in the folder where you want it. If you add a new item, it will default to the same folder. That is where the annoying part comes in. If you create 3 folders for all your project items and try to add a new item to each folder, Visual Studio will try to put all 3 items in the same place in the file system (the last folder you added a new item to), while putting items into the correct Visual Studio folder.

    It is possible there is a setting for this in Visual Studio. I haven't found it. I also haven't looked that hard.

提交回复
热议问题