VS IDE 2019 How to fix "Unable to start program...

m robot 21 Reputation points
2021-05-31T16:57:18.743+00:00

Recently installed Visual Studio IDE 2019 version 16.10.0. I get no errors when BUILDING SOLUTION from the main.cpp file. But, when I run START DEBUGGING I get the error below. How do I fix this?:

png titles:

  1. Debug Error Message
  2. Properties for main.cpp, Cube.cpp, Cube.h
  3. More properties
  4. Folder structure where Cube.h, Cube.cpp, and main.cpp are located The solution and project files are up one folder in /dataStructure
  5. VS C++ Template used for project
  6. VS Tools installed on my machine

101119-image.png

101120-image.png

101191-image.png

101087-image.png

101109-image.png

101192-image.png

Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
999 questions
0 comments No comments
{count} votes

Accepted answer
  1. Sam of Simple Samples 5,546 Reputation points
    2021-05-31T18:15:15.347+00:00

    Your solution is called dataStructures and consists of the two projects dataStructures and week1a-cube. The dataStructures project has no source code but is set as the startup project. I can tell that dataStructures is the startup project because it is highlighted in the Solution Explorer. Visual Studio is trying to execute dataStructures.exe because that would be the name of the executable if dataStructures had source code that results in an executable.

    We do not know what you need to do. One of your images show creation of an empty project. That is good if you want a solution with multiple projects. At this point if you want to execute the executable created by the source code in the week1a-cube project then do as RLWA32 says; make week1a-cube the startup project. Right-click week1a-cube and select the item for doing that.

    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. RLWA32 45,576 Reputation points
    2021-05-31T17:35:17.303+00:00

    Make sure that the week1a-cube project is set as the start-up project for the solution.
    For example -
    101166-startup-projectpng.png

    2 people found this answer helpful.

  2. m robot 21 Reputation points
    2021-05-31T17:01:08.837+00:00

    The third image is a mistake and should have been the image here below for the linker settings:

    101177-image.png


  3. m robot 21 Reputation points
    2021-05-31T19:16:51.067+00:00

    I created the Solution in the same folder as the Project. Once I recreated everything with the solution as the top folder and the project under the solution, it ran like a charm.

    Thanks @RLWA32 and @Sam of Simple Samples !

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.