DCoward
DCoward

Reputation: 41

Running a single .cpp file in Visual Studio 2015?

This is my first post. I promise I tried to search for something that applied, but I've yet to find anything -- I apologize if I somehow missed it.

Ok.

So as the question states, I'm trying to compile and run a single .cpp file in VS2015 Community edition.

The reason I am doing so is because I am following a tutorial from Handmadehero.org, and they are mostly using VS as a debugger and compiler (If I understood correctly), so technically I don't REALLY need VS specifically, but I really want to follow along. Granted, they had a different version (not sure which exactly, I think they said 2013).

They were able to, through command line, call up VS with devenv [insert path to file] and then, as they put it, VS created a dummy solution.

However, when I tried to replicate this, I can pull up the file, but I cannot compile or run.

When I found that it might be that this version needs a new project for the file to fit into, I tried, but I am fairly inexperienced with IDEs, VS included, and I'm honestly not sure which setting to use, because I've tried a few and it either says it cannot access the program, or it pulls up a project with zero output and I am unsure of what to do at that point.

I'd greatly appreciate some help in pointing me to the right info!

TL;DR, I'm following a tutorial that uses VS as a debugger/compiler and runner, but idk how to get a single file to operate, and need help.

Thanks!

Upvotes: 2

Views: 860

Answers (2)

mohamad kamel
mohamad kamel

Reputation: 21

you can use code blocks Application it work with me in windows

Upvotes: -1

DCoward
DCoward

Reputation: 41

Answer: So I derped -- it was my bad. I misunderstood something vital in the videos and I was supposed to be using the devenv command to load in a .exe, not a .cpp file.

As it turns out, I am fairly certain that you really can't load in just a lone .cpp file as I was trying to do, so if anyone is trying to do anything like I was trying, the best I can say is make sure you're using the right file for your project!

Lesson learned.

Upvotes: 2

Related Questions