![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| In C Program, determine if job is running | BCarlson | High Level Programming | 12 | 07-16-2006 09:05 AM |
| running a program for a specified time | prosputko | High Level Programming | 3 | 07-06-2005 10:39 AM |
| running dos program from unix server | rkap | UNIX for Dummies Questions & Answers | 1 | 04-06-2005 07:48 AM |
| Running a program | perleo | UNIX for Dummies Questions & Answers | 3 | 08-23-2002 07:34 AM |
| Running a compiled Program | Krebsbac | High Level Programming | 2 | 09-07-2001 01:39 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
running a c/c++ program in unix
This is not a question, but rather a simple how-to for
programmers who are new to the UNIX environment. I too,am new to UNIX. First I developed a few programs on my box and perfected them until they were satisfactory for execution. Problem was however, that once i compiled and all that, it occured to me, that i was new to Unix and had no freakin clue about how to run my apps from the command-line. I couldn't for the life of me figure out how in the !$#@ to do this. To experienced users, this is probably 'duh!' however, to a new user like myself, this was all frustrating. I spent a long time working on my little program and assumed that if it works it would run. Makes sense to me. --------- Well, i was very wrong, and after i compiled my source file "myprogram.c" with the GNU CC compiler using the line: cc myprogram.c then another file appeared, called: a.out This was because i didn't specify a name for my program. Having very little patients with the available documentation, I found nothing about running a program once you've created it. So i tried typing my programs name in: a.out [ENTER] No good, instead i get a reply back saying: a.out: Command not found. I just wanted my freakin program to run. Well, good news, it 'turns out' that prefixing the programs name with "./" works. --thats a dot, a slash and then the programs path and name so finally i entered: ./a.out [ENTER] and voila! the darn thing worked. If this seemed a bit long winded, it was. I just hope this helps someone in the future. late, kray
__________________
na |
| Forum Sponsor | ||
|
|
|
|||
|
You can get around with a solution over this. Try including the following line in your ~/.profile
Code:
export PATH=.:$PATH |