- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I was wondering if it's possible to compile a source file in Visual Studio without going through the whole project creation procedure. The only reason I use Visual Studio is for the text editor. I usually compile everything from the command line, but sometimes I'd like to use the Visual Studio debugger (saves me from writing a ton of print statements into my code...). However, when I want to do this, I have to go through the tedious process of creating a new project, and adding the existing source code into this project, and then also telling MS Visual Studio where it can find library files such as the intel MKL ones. If my program uses input files, I have to then copy these files into the folder where MS Visual Studio created the project. I don't like creating the project folder where my actual source files are because it contaminates this folder with a bunch of files that I'll never use.
Anyway, what I want to know is if I can just open a file with the Visual Studio text editor and then compile it right away, and run the debugger without jumping through all sorts of hoops.
Thanks,
Alexis
I was wondering if it's possible to compile a source file in Visual Studio without going through the whole project creation procedure. The only reason I use Visual Studio is for the text editor. I usually compile everything from the command line, but sometimes I'd like to use the Visual Studio debugger (saves me from writing a ton of print statements into my code...). However, when I want to do this, I have to go through the tedious process of creating a new project, and adding the existing source code into this project, and then also telling MS Visual Studio where it can find library files such as the intel MKL ones. If my program uses input files, I have to then copy these files into the folder where MS Visual Studio created the project. I don't like creating the project folder where my actual source files are because it contaminates this folder with a bunch of files that I'll never use.
Anyway, what I want to know is if I can just open a file with the Visual Studio text editor and then compile it right away, and run the debugger without jumping through all sorts of hoops.
Thanks,
Alexis
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No, but you don't have to create a project to debug (but it does help). From the command line, you can type:
devenv myprog.exe
to debug it. You may need to specify the full path to devenv.exe. However, this may be of limited use - you can't set breakpoints ahead of time.
You can build from the command line and use a simple project to debug, though - I did that just today. Create a project and add your source files to it. Change the linker output file to be the path to your EXE, set a breakpoint, and go.
devenv myprog.exe
to debug it. You may need to specify the full path to devenv.exe. However, this may be of limited use - you can't set breakpoints ahead of time.
You can build from the command line and use a simple project to debug, though - I did that just today. Create a project and add your source files to it. Change the linker output file to be the path to your EXE, set a breakpoint, and go.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page