I recently installed Visual Studio 2013. I can create a new project (Visual C++), but the error I have to come across is that I cannot run the app. Here is the code that I'm trying to run on Visual Studio 2013.
#include <iostream> using namespace std; int main() { cout << "Hello World"; return 0; }
I am sure this code would run, and will output hello world, but in Visual Studio it gives me issues, saying:
Values cannot be null,
Parameter name: solutionDirectory.
What am I missing here?
Here is an image for this:
The Visual Studio build tools include a C compiler that you can use to create everything from basic console programs to full Windows Desktop applications, mobile apps, and more.
After stopping the C file, go & click the File button at the top left corner of the Visual Studio Code Editor, and select the Settings via Preferences, as shown below image. After clicking the Settings, it shows the image below. In this image, select the extension button to set the settings for the C Compiler.
In Visual Studio, you can't just open a .cpp
file and expect it to run. You must create a project first, or open the .cpp in some existing project.
In your case, there is no project, so there is no project to build.
Go to File --> New --> Project --> Visual C++ --> Win32 Console Application
. You can uncheck "create a directory for solution". On the next page, be sure to check "Empty project".
Then, You can add .cpp
files you created outside the Visual Studio by right clicking in the Solution explorer
on folder icon "Source" and Add->Existing Item.
Obviously You can create new .cpp this way too (Add --> New). The .cpp file will be created in your project directory.
Then you can press ctrl+F5 to compile without debugging and can see output on console window.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With