Command-line Arguments.

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Sep 2004
Posts: 22
Reputation: Layla_2401 is an unknown quantity at this point 
Solved Threads: 0
Layla_2401 Layla_2401 is offline Offline
Newbie Poster

Command-line Arguments.

 
1
  #1
Mar 26th, 2005
Hi,
I'm using MS visual studio 6 for a C++ program. I am able to run the program from IDE, but when I've attempted to run it from the command line, I get a message the program name is unrecognizable. I've included the following code:

  1. int main(int argc, char *argv[])

But I've noticed that after building the project I don't have an .exe in the workspace.
My question is: are there any project or workspace configuration steps that I must follow in order to get the .exe file? or what could it be that I'm doing wrong?

Thank you all in advance.
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,603
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 713
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: Command-line Arguments.

 
0
  #2
Mar 26th, 2005
>But I've noticed that after building the project I don't have an .exe in the workspace.
Look in the Debug folder.
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 199
Reputation: Tight_Coder_Ex is an unknown quantity at this point 
Solved Threads: 14
Tight_Coder_Ex's Avatar
Tight_Coder_Ex Tight_Coder_Ex is offline Offline
Junior Poster

Re: Command-line Arguments.

 
1
  #3
Mar 26th, 2005
When you created this project you may have inadvertantly selected of the 15 choices the wrong type. In your case Win32 Console Application would have been the one you wanted. There are also several other settings that could have been corrupted, so the simplest thing to do is create a new console project, attach your headers and source files and re-build.
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 22
Reputation: Layla_2401 is an unknown quantity at this point 
Solved Threads: 0
Layla_2401 Layla_2401 is offline Offline
Newbie Poster

Re: Command-line Arguments.

 
0
  #4
Mar 27th, 2005
Narue & Tight Coder:
Thank you two for your input, the project is set to Win32 console application, but I found the .exe in the release folder.

Thanks again guys.
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,603
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 713
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: Command-line Arguments.

 
0
  #5
Mar 27th, 2005
>but I found the .exe in the release folder.
I was close. Most people who post questions here I wouldn't expect to compile in release mode.
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 22
Reputation: Layla_2401 is an unknown quantity at this point 
Solved Threads: 0
Layla_2401 Layla_2401 is offline Offline
Newbie Poster

Re: Command-line Arguments.

 
0
  #6
Mar 27th, 2005
I do have another question though,
Now that I have located and ran the .exe from the command line, the program isn't running correctly, while it does from IDE. At this stage I'm not actually passing any arguments to main, I'm simply calling the program as follows:

c:\>Server

Is this a common problem caused by something I've overlooked (or needs to be modified) or is related entirely to my code?

Your help is highly appreciated.
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,603
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 713
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: Command-line Arguments.

 
0
  #7
Mar 27th, 2005
If the program relies on command line arguments, not passing them will result in incorrect behavior (in the form of an error message if you wrote your program correctly).
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 22
Reputation: Layla_2401 is an unknown quantity at this point 
Solved Threads: 0
Layla_2401 Layla_2401 is offline Offline
Newbie Poster

Re: Command-line Arguments.

 
0
  #8
Mar 30th, 2005
I got it, Thanks again.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC