- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Moderator,
I would like to see posted the definitive solution to trying to debug a IVF console application in Visual Studio .NET with redirection of input (unit 5) and output (unit 6). In the project properties pages if I select the Debugging section I get three text boxes displayed : Command, Command Arguments, and Working Directory. The Command textbox by default shows the text $(TargetPath). If I select Start from the Debug menu the console application runs as I would expect : it writes to the console window and accepts typed input in the console window. If I change the Command Arguments textbox to read output.txt and select Start then I get an error display that says :
Unable to start debugging.
Unable to start program (displays the path to the debug executable and its name)
Output cannot be redirected because specified file is invalid.
The Working Directory textbox is left blank (and I verified the project directory is the default by having some code at the beginning of the program create and write to a file - which showed up in the expected directory).
I didn't have this problem in CVF 6.x.
Thanks,
Ken Fowler
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've noticed this too - it appears to be a VS.NET thing. Some kinds of redirection do work, such as 2>&1, but file redirection seems to be ignored. I'll see if I can locate some information on how to get this to work.
Here's a workaround. Start a Fortran command build environment session (Start..Programs..Intel Software Development Tools.. Intel Fortran Compiler..Build Environment for IA-32 Applications. Define the environment variables FORT5 and FORT6 to point to the files, such as:
set FORT5=input.txt
set FORT6=output.txt
now type "devenv" to open the IDE, then open your solution. Now when you debug, these environment variables will be defined and will redirect the files.
Here's a workaround. Start a Fortran command build environment session (Start..Programs..Intel Software Development Tools.. Intel Fortran Compiler..Build Environment for IA-32 Applications. Define the environment variables FORT5 and FORT6 to point to the files, such as:
set FORT5=input.txt
set FORT6=output.txt
now type "devenv" to open the IDE, then open your solution. Now when you debug, these environment variables will be defined and will redirect the files.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I verified that MSVC has the same problem. MS has acknowledged that it is a bug and says it is fixed in "the next version" (presumably VS2005).
I did find that if you specify an explicit path for the input and output file, for example:
< C:myprojectinput.txt > C:myprojectoutput.txt
it works. This goes in Command Arguments. Specifying the working directory doesn't help. Bizarre.
I did find that if you specify an explicit path for the input and output file, for example:
< C:myprojectinput.txt > C:myprojectoutput.txt
it works. This goes in Command Arguments. Specifying the working directory doesn't help. Bizarre.

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