Welcome to the most active Linux Forum on the web.
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 04-28-2005, 07:32 PM   #1
Registered: Apr 2005
Location: Albany, NY
Distribution: Fedora Core 6
Posts: 85

Rep: Reputation: 15
Compiling C with GCC in Fedora

[CODE]$ ls
fig02_01.c fig02_01.c~ fig02_03.c
$ man gcc

[1]+ Stopped man gcc
$ gcc fig02_01.c
$ ls
a.out fig02_01.c fig02_01.c~ fig02_03.c

Now, from what I can remember that a.out is assigned if I don't assign a name to what I compiled? Is that correct? I guess a.out means that it's compiled, so how do I see the results? Run it, I guess? I've been looking on linux command dir, and I don't see anything that resembles what I remember.


Old 04-28-2005, 07:41 PM   #2
Registered: May 2004
Distribution: FreeBSD 7, Debian "Squeeze", OpenBSD 4.5
Posts: 167

Rep: Reputation: 30
If what you are compiling is a program you should be able to chmod 755 a.out and then run it using the command ./a.out.

And yes, a.out is the default name.
Old 04-28-2005, 08:27 PM   #3
Registered: Jan 2005
Location: Australia
Distribution: LFS 6.0 #15056
Posts: 50

Rep: Reputation: 15
to change the name it outputs to use -o [filename] switch, you should also use -Wall to show all the compiler warnings.
Old 04-28-2005, 10:01 PM   #4
Registered: Apr 2005
Location: Albany, NY
Distribution: Fedora Core 6
Posts: 85

Original Poster
Rep: Reputation: 15
$ ls
02_01  fig02_01.c
$ ./02_01
Welcome to C!
^ 1337. WATCH OUT! @_@ Thanks for the help guys.


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
Kernel compiling: gcc-3.3 is 586, should be gcc-3.3 386 Erik Plaggenmar Linux - Software 0 10-01-2004 12:38 PM
Various Compiling Errors (GCC compiling Openal, GUIlib, xmms-wma) gregorya Linux - Software 2 08-27-2004 06:03 AM
Compiling gcc CuteBug Linux - Software 2 02-22-2004 10:19 AM
Fedora running VMware/GCC compiling atko Fedora 3 12-14-2003 07:49 AM
Compiling C++ GCC poeta_boy Linux - Newbie 14 10-14-2003 05:23 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:55 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration