Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-05-2004, 08:17 AM   #1
LQ Newbie
Registered: Sep 2004
Posts: 1

Rep: Reputation: 0
Thumbs down how to run compiled C file.

Hi there.

im very very noob at linux/unix and all shell stuff.
I just bought a shell accout to study C programming (-:
I wrote 'hello world' example.
Compiled it like so: gcc test.c
I got a.out (dont know what it is)

And my question would be: how to run it ? (-:
I just wanna see 'Hello world' ... :/
Old 09-05-2004, 08:23 AM   #2
Senior Member
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851

Rep: Reputation: 47
the a.out is the executable
simply type
to compile it with an executable called helloworld, you'd do this:
gcc -o helloworld helloworld.c
gcc - call the compiler
-o - the next argument is the Object file (the executable)
helloworld - the object for reasons stated above
helloworld.c - the source
Old 09-05-2004, 08:24 AM   #3
LQ Newbie
Registered: Jan 2003
Location: Nepal
Distribution: Redhat
Posts: 11

Rep: Reputation: 0

If your working directory is the same where the a.out file is, then enter the following at command prompt.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Run executable file compiled by kylix and mysql in Fedora Core 4 aa_husni Fedora 0 09-15-2005 01:14 AM
Executable compiled w/gcc won't run brancheb Programming 5 05-16-2004 02:56 PM
why ./ is used to run C++ compiled programs legend1079 Red Hat 4 03-23-2004 07:32 AM
how to run C++ compiled program legend1079 Linux - Newbie 2 03-20-2004 07:40 AM
cannot run C compiled programs Astro Slackware 7 01-27-2004 11:32 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:05 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration