The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
In C Program, determine if job is running BCarlson High Level Programming 12 07-16-2006 01:05 PM
running a program for a specified time prosputko High Level Programming 3 07-06-2005 02:39 PM
running dos program from unix server rkap UNIX for Dummies Questions & Answers 1 04-06-2005 11:48 AM
Running a program perleo UNIX for Dummies Questions & Answers 3 08-23-2002 11:34 AM
Running a compiled Program Krebsbac High Level Programming 2 09-07-2001 05:39 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 07-11-2002
kray kray is offline
Registered User
  
 

Join Date: Jul 2002
Posts: 1
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
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes 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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:32 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0