Trying to run a short piece of code from a tutorial in Visual Studio 2015. Unfortunately, every time I hit the Debug Button (F5) I receive the message
"Unable to start program C:\folder\folder\folder\folder\projectfilename.exe" ...
... where 'folder' and 'projectfilename' are stand-ins for the actual folder and filenames.
I've checked the location that the error dialogue points to and there is no .exe file present.
I've tried 'build'ing my project (by going to the 'Build' menu and selecting 'Build Solution' both as an x32 and x64 version of a debug and release build. None of these methods result in a .exe being generated, which is what the debugger appears to be looking for in order to launch the code.
Any ideas what to do?
I have followed this tutorial step-by-step but am experiencing the above error. What am I doing wrong.
Link to the Tutorial I've been following (including the exact code I'm trying to run):
In Visual Studio with the project open shift+alt+A to open the add existing item dialog. Select the source file and click OK. The file should now show in solution explorer under Source Files.
I'm not totally certain what you mean by Source File. Have done some research but found no conclusive answers online. Sorry, I'm a total beginner.
Do you mean a header file, such as those referenced with the format #include <headername>?
I have followed the instructions in the linked tutorial to the letter and the error log window reports absolutely no errors, only the popup window which I described in my first post.
Not really certain what the purpose/function of a source file is and how I should identify one. Search engine results haven't shed much concise light on the subject.
A source file is a file that contains code that is compiled. For example, "main.cpp". This is in contrast to a header file, which also contains code but is compiled only indirectly when it is included in source files.
Try cleaning and rebuilding in case any artifacts from previous builds are causing problems. Pay special attention to linker errors with your library; if the exe isn't appearing it may be because the build is failing.
If that doesn't work, try creating a new project in a new directory and see if it fails in the same way.
If that doesn't work, I'd want to check if the library is being installed correctly. Check to make sure it is putting its binaries wherever VS is looking for them and that your headers can be found; I don't know where nuget puts that stuff.
I'm still fairly sure you are getting this error because when you try to compile the project with F5 there is no source code to compile so no executable is generated. Where are you putting the code from the tutorial?
From the project press Ctrl+Shift+A to create a new file. From the new file dialog select C++file (cpp) and paste the tutorial code into the new file then compile.
When you copied the code from the tutorial you got an html encoded ampersand, it is in the tutorials code but shouldn't be. Your line 27 looks something like glutInit(&argc, argv); when it should be glutInit(&argc, argv); just delete the amp; leaving the actual ampersand.