Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29235 Discussions

Compiling with ifort and Visual studio

alexismor
Beginner
537 Views
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
0 Kudos
1 Reply
Steven_L_Intel1
Employee
537 Views
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.
0 Kudos
Reply