C Board  

Go Back   C Board > General Programming Boards > C Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 11-14-2009, 10:28 AM   #1
Registered User
 
Join Date: Oct 2009
Posts: 22
Real basic compile/run question

I'm still new to C and am having trouble running a compiled program.

In the past when I compile on Linux I never specified a name of the file, so I would run the program with this command line argument:
./a.out

Now when I compile, I am adding "-o myPgm" to the command line argument. How do I run the program now?

Again, the OS is Linux.
Roger is offline   Reply With Quote
Old 11-14-2009, 10:33 AM   #2
subminimalist
 
MK27's Avatar
 
Join Date: Jul 2008
Location: NYC
Posts: 3,944


./myPgm

You need to use ./ to specify an executable in the current working directory. This is to prevent confusion with binaries in the $PATH environment variable.
__________________

Accuracy and integrity mean nothing if you don't make it past the censors...PYTHAGORAS
MK27 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Basic question about GSL ODE func RK4 cosmich Game Programming 1 05-07-2007 02:27 AM
Basic C question ---- URGENT x135 Linux Programming 3 03-25-2006 11:05 PM
Visual Basic Question? ob1cnobe C++ Programming 2 07-03-2002 09:31 AM
A very basic question AshFooYoung C Programming 8 10-07-2001 03:37 PM


All times are GMT -6. The time now is 07:51 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22