Copy source files to a Visual Studio project

I created a new Visual Studio C ++ project, and I would like to import copies of several C files and headers into the project. That is, the files are currently located in a folder on my desktop, and I would like to import them so that the copies are placed in the newly created project folder.

How can I do it? I tried using File | New | Project from existing code , but it just saves the files in their existing location. I even tried a simple Ctrl-C and Ctrl-V and again, which imported the files, but they remained in the same place on the disk.

+4
source share
2 answers

I think the best solution would be to create a new (empty) project and add your h and cpp files to "Add → Existing Element" in the "Headers" and "Sources" context menu

+1
source

Copy the files to a new location in Windows Explorer, then start Visual Studio and add them as existing elements to the project.

0
source

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


All Articles