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 02-25-2010, 10:19 AM   #1
LQ Newbie
Registered: Feb 2010
Posts: 18

Rep: Reputation: 0
run c-files

This is not working for me, I cant run my c-code files.
this is how I do:

gcc fileName.c

but I cant get it to run!

I have gcc installed. Whats wrong?

I only get, no such file or...

Do I have so save the file somewhere special?
Old 02-25-2010, 10:38 AM   #2
Registered: Apr 2007
Location: the Rocket City
Distribution: Debian, Ubuntu, CentOS; in days past Fedora, Solaris, SunOS, 4.2BSD, 4.3BSD, SVR4, AIX, HP-UX
Posts: 101

Rep: Reputation: Disabled
First, try "man gcc". Man is your friend.

Second, I believe that gcc leaves its executable output in a file called a.out by default. To produce a different file, use the -o option. For instance, try "gcc foo.c -o foo". That will compile a file "foo.c" and produce an executable "foo". To execute, try "./foo". Of course, use your own filenames rather than "foo".

gcc has many interesting options. Check gcc manuals, particularly man and info.


Last edited by ordinary; 02-25-2010 at 10:39 AM.


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 .RUN FILES at ubuntu 9.10 Taso5 Linux - Software 17 11-30-2009 05:57 PM
Converting text files to files that can be run in the terminal. jkmurph13 Linux - Newbie 1 12-09-2008 11:33 PM
How do I run .run and .exe files? AAJJCC Linux - Newbie 8 03-24-2006 07:46 PM
How do I run those .run files? IanPappas Linux - Software 2 09-29-2005 06:18 PM
How do you decompress files, or run files such as the Netscape 6 Uninstaller in RH7.2 oudent Linux - Newbie 1 11-19-2001 01:11 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:23 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
Open Source Consulting | Domain Registration