Visual Studio 2019 is not running other .cpp files

jroes

enter image description here

New to VS and C++. I'm trying to run code for source file "test2.cpp." However, every time I run the program, VS always runs "Simple-letter-with-ASCII-number.cpp."

I'm on the "test2.cpp" window, but the file never runs. I need assistance in running "test2.cpp" and not "Simple-letter-with-ASCII-number.cpp," without deleting any .cpp files, if possible.

  • Both .cpp files have different labeled main()
  • Both .cpp files are in the same project
blackdrumb

Your project will call main() when it runs. When you said “differently labeled main()” I am assuming you changed a main() to test2main(). Just change the main function you want to run to be main() and your program should run when you recompile.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Visual Studio community 2019 cannot add cpp files to project

Visual Studio 2019 not building all cpp files when a header file changes

Running a single .cpp file in Visual Studio 2015?

Visual Studio 2019: JS files not recognized as pending change while other files are

Visual Studio can't see .cpp files

Yaml_cpp in debug with visual studio 2019 and cmake

Generate the EDMX backing files in Visual Studio 2019

Linking multiple files with MASM and Visual Studio 2019

compile separate .cpp files for function definitions and header files in Visual Studio

Running JS on other sites with Visual Studio?

Source file header file and other files are not displayed when I create empty C++ Project in visual studio 2019

Visual Studio 2015 IntelliSense in .cpp files #included as headers

How to include an header automatically in all cpp files in visual studio?

Compile multiple .cpp files in Visual Studio Code with clang++ on macOS

Cannot include .cpp and .h files in Visual Studio 2022

Visual Studio Community 2019 - Running, Installation and Reporting Issues

Publish Profile Targets Not Running Visual Studio 2019 MVC Project

Getting NullReferenceException on IIS Express while running from Visual Studio 2019

Visual Studio , including CPP file inside other CPP - issues in existing project

Are there any Visual Studio 2019 extensions for Unity .shader files?

Visual Studio 2019 not picking up CS generated files

How to enable ESLint for TypeScript files in Visual Studio 2019?

Automatic include files in folder in Visual Studio 2019 project

Visual Studio 2019 - Use PowerShell to open files instead of Solution Explorer

Visual studio 2019 - Publish to a folder does not publish all files

Edit Xaml files on debuging Visual studio 2019, WPF

How to get Visual Studio 2019 to compare files side by side again?

Generate graph of include files in Visual Studio Community 2019

GDAL Library Header Files Error and Warningsin With Visual Studio 2019