GIDForums  

Go Back   GIDForums > Computer Programming Forums > C Programming Language
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 08-Mar-2007, 19:19
Relay Relay is offline
New Member
 
Join Date: Mar 2007
Posts: 3
Relay is on a distinguished road

Problem Executing Program Via command prompt: Windows vista


I am running Windows Vista Home Premium. I was beginning to learn C programming on my win xp computer. I made the program in a compiler, saved it, compiled it, went to command prompt, cded to the folder the file was stored and then typed then name of the file and hit enter.

Now, for instance, I wrote a file and saved it and compiled it. I opened cmd, cded to the folder, and typed the name of the file and hit enter. The .obj file IS present in the folder my programs are stored in. I get an error that the name of the program is not recognized as an internal or external command, operable program or batch file.

Example- The name of the program I made was printf. Saved printf.c in the C folder on my destop. I checked, the compiler created the .obj file in the folder.

I open command prompt, cd to the folder, type in 'printf'.
And command prompt slaps this in my face:

'printf' is not recognized as an internal or external command, operable program or batch file.
  #2  
Old 08-Mar-2007, 22:21
dlp dlp is offline
Member
 
Join Date: May 2006
Posts: 143
dlp will become famous soon enough

Re: Problem Executing Program Via command prompt: Windows vista


What compiler are you using? Visual Studio? Are you sure there's an acutal program in there called "printf"? Usually, if I make a basic project for a C or C++ program, it makes the program in a folder called "Debug" in the project folder.
  #3  
Old 09-Mar-2007, 06:18
Relay Relay is offline
New Member
 
Join Date: Mar 2007
Posts: 3
Relay is on a distinguished road

Re: Problem Executing Program Via command prompt: Windows vista


I am using Miracle C. I save my files in a custom folder.
  #4  
Old 09-Mar-2007, 09:54
davekw7x davekw7x is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Left Coast, USA
Posts: 4,893
davekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to behold

Re: Problem Executing Program Via command prompt: Windows vista


Quote:
Originally Posted by Relay
I save my files in a custom folder.

So: look for an executable file and go to that directory. The .obj files are not executable. They are intermediate "object" files that are sometimes created by a compiler when building an executable. The executable will be named "something.exe", not "something.obj"

Regards,

Dave
  #5  
Old 09-Mar-2007, 13:54
Relay Relay is offline
New Member
 
Join Date: Mar 2007
Posts: 3
Relay is on a distinguished road

Re: Problem Executing Program Via command prompt: Windows vista


There is no .exe file in the folder
only the src code and .obj file
  #6  
Old 09-Mar-2007, 13:57
WaltP's Avatar
WaltP WaltP is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Midwest US
Posts: 3,281
WaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to all

Re: Problem Executing Program Via command prompt: Windows vista


And the only time I recommend changing compilers is when someone is using Miracle C. I have never heard anything good about it. Try one of these, all free:
Borland 5.5
Open Watcom C++/Fortran
Bloodshed DevC
MSVC++ Express
__________________

Got a cough? Go home tonight and eat a whole box of Ex-Lax. Tomorrow, you'll be afraid to cough.
-- Pearl Williams
 
 

Recent GIDBlogI?m Home by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Airport Log program using 3D linked List : problem reading from file batrsau C Programming Language 11 29-Feb-2008 08:44
Windows C++ Problem with Class and Functions Alloishus C++ Forum 3 28-Sep-2006 19:34
Pipeline freeze simulation darklightred C++ Forum 6 27-Jul-2006 20:37
Executing a program inside a C# program? xanstrange .NET Forum 2 17-Mar-2006 08:53
Runtime Problem involving "printf" in C Program supamakia C Programming Language 2 09-Oct-2005 11:09

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 01:56.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.