Niccolo wrote: |
---|
The short answer, @jsurow, is no. |
Not true. I import already created source files into projects all the time. And have zero problems with configuration details.
If you want to import an already created .cpp/.h file(s) to a project it is insanely easy.
1. Create an empty project/solution. No files added. The default name is Project1. The number changes if you have more than one default named project. The configuration defaults to a console app.
I repeat. CREATE AN EMPTY PROJECT/SOLUTION.
I always change the project and solution names to something descriptive of my program. For example, I might name the project MyGame1 and the solution name to MyGames. I can now have multiple similar projects under the umbrella of one solution.
2. Copy your .cpp/.h file(s) to the project/solution root directory.
3. From the project menu Add Existing Item. From the file/folder dialog select the file(s) you want to add to the project. The added file(s) should now show up in the Solution Explorer file tree. Visual Studio now will be able to compile and link the file(s).
Personally every project I start I begin with an empty project, adding existing and new files as I need them. The empty project defaults set the configuration settings among other things to NOT have precompiled headers, something I despise.
Precompiled headers can cause compile/link problems in my experience, even with a complete project/solution rebuild. I have yet to create a project that using precompiled headers has made a significant time saving when editing/compiling/reediting phase.
If you want to create a project/solution for a Windows GUI app you can and should use the Windows Desktop Wizard. You can still create an empty project, with the ability to change key configuration details as needed.