An empty project is just that - empty, no source is generated. You need to add some source files.
Do yourself a favour and start by creating a new C++ console project.
Lines of code not appearing in Visual Studio 2019
I've been learning C++ in Visual Studio 2019. Whenever I make a new project or open an old one, the lines of code simply don't appear. If there is an option to unhide the lines, could you point me out as to how. If this is in fact a serious issue, is there any fixes?
Please note - I have already tried uninstalling and re-installing, but that didn't change anything.
https://www.youtube.com/watch?v=cnJBR7juYK0
^^^Please watch this YouTube video so I can explain my issue better^^^
Developer technologies | Visual Studio | Other
3 answers
Sort by: Most helpful
-
David Lowndes 4,726 Reputation points
2021-06-28T10:25:03.943+00:00 -
Michael Taylor 60,161 Reputation points
2021-06-28T13:14:24.247+00:00 In the video you created a new project and asked for it to be empty so you literally got an empty project. What were you really wanting to do?
If you wanted to open one of your old projects with code you've already written then double click the project in the Recent list on the left side of the Start Window. If it doesn't appear there then use the Open a Project button on the right side instead and browse to it.
If you want to start with a C++ project that has the standard boilerplate code that you can then delete then use the Console App (C++) template, for a console app. This generates the same project as empty but includes a .h/.cpp file with some starter code that you can remove. If you want a more complex app then use one of the other C++ templates.
-
PengGe-MSFT 3,381 Reputation points
2021-06-29T02:27:26.18+00:00 Hi, @Finlay Gilzean
Welcome to Microsoft Q&A!
You created an empty project, which means it has no files, so you will get an error message when you build and run this project.
You can create a new C++ file in the Source Files, enter some code, and then build and run it.You can also refer to this document to learn how to use Visual Studio.
Sincerely,
Peng
*
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread