LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 09-05-2004, 08:17 AM   #1
cdmn
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
scuzzman
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
Code:
./a.out
to compile it with an executable called helloworld, you'd do this:
Code:
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
bijay
LQ Newbie
 
Registered: Jan 2003
Location: Nepal
Distribution: Redhat
Posts: 11

Rep: Reputation: 0
Hi,

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


./a.out
 
  


Reply


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


All times are GMT -5. The time now is 08:19 PM.

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