IARGC Not working

IARGC Not working

Hi All,

I need help with IARGC in my Fortram C code. I am using Intel Fortan compiler version 9.1.3192.2005 with Visual Studio 2005 on a windows 7 64 bit machine.

My code has worked fine on XP 32 bit. The problem I am facing now is the IARGC call is always returning 0.

When I am in debugging mode (f5) it returns the right number of arguments but when I run with Ctrl + F5 - ie start without debugging, IARGC returns 0.

I have tried GET_COMMAND_ARGUMENT call.That too is behaving same as IARGC.

Please if someone has faced a similar problem or knows the reason for this, it would be a great help.



15 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

2011.10.325 when VS 2010 Properties | Debug | Command Arguments | a, b
32-bit app run on Windows 7 x64 platform

Returns 2 for both F5 and Ctrl-F5

Jim Dempsey

Jim, Are you saying it works and returns the rigth number of arguments in either case?

I am looking for someone to comment on reasons it may not work like in my case it doesnt. Maybe some VS settings?

The default in VS is to run the compiled .EXE file with no arguments. As Jim pointed out, you have to enter command line arguments into the appropriate "property" pane in the VS settings.

I have specified the "command Arguments" in Configuration properites/Debugging - the right place where it is supposed to be in VS.

Thats why when I do F5 it gets the right number of arguments. The issue seems to be when I use Ctrl+F5, I get zero. Any insight into that?


I see 2 for both runs. What you may be seeing is a VS integration issue. What happens when you launch a CMD window and run from there?

Jim Dempsey

Hello Jim,

Sorry I couldnt reply earlier. Like you suggested, I tried the exe from CMD window, IARGC picks up the right no. of arguments even from CMD.

So CMD and F5 options are behaving same and correct, but with Ctrl+ F5  IARGC is giving 0 for me.


I also want to add that I have tried GET_COMMAND_ARGUMENT as well.

GET_COMMAND_ARGUMENT is behaving the same way as IARGC for me. ie returning 0 when run with Ctrl + F5.

From command line and just F5 option, both return the correct number of arguments.

I can't reproduce this problem with a current compiler. No matter how I invoke a program, both IARGC and COMMAND_ARGUMENT_COUNT (which I assume is what you are using) return the number of arguments I have specified in Debugging > Command Arguments. 

I see you are using 9.1. That was never officially supported on Windows 7, though I would not have expected a problem such as this. Even so I would encourage you to upgrade.

Retired 12/31/2016

This "sounds" like a VS integration issue. IOW nothing to do with the compiler.

The usual way of handling VS integration issues is to un-install and re-install IVF. You could alternately edit some script or html file somewhere. I do not know what or where to locate the script/html that performs F5 and Ctrl-F5.

Jim Dempsey

I looked in our problem database and found that exactly this problem was reported back in 2006. It was fixed in a 9.1 update sometime after August 2006.

Retired 12/31/2016

Also - the bug was in the VS integration, not in the compiler or libraries.

Retired 12/31/2016

Thanks Jim and Steve.
I will install the update and let you know


Is it possible to point me to the right update and/or where to find the update?



See  How do I get an older version of an Intel® Software Development Product I can't see a license under your email address so I don't know what you're eligible to install. The only 9.1 version provided is from October 2007. If your license support expiration date is before that, you won't be able to use that.

Retired 12/31/2016

Leave a Comment

Please sign in to add a comment. Not a member? Join today