LinuxQuestions.org
Help answer threads with 0 replies.
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 11-07-2007, 10:06 AM   #1
lifeafterdeath
Member
 
Registered: Oct 2007
Location: Bangalore, India
Distribution: SUSE 10.1 SP1, Fedora 7, Fedora 8, Ubuntu 8.04, Ubuntu 9.04
Posts: 65

Rep: Reputation: 15
problem with compiling a c program


I installed gcc in my suse 10 sp1. Just to give a try, I wrote a simple hello world program. I tried compiling it by giving

cc hello.c

It showed nothing. Then when I gave a.out it says

a.out: command not found.



Plz help me with this..
 
Old 11-07-2007, 10:10 AM   #2
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
The compiler is called "gcc", not "cc", although there may be an symlink from cc to gcc. Probably the current working directory is not in the PATH, so you need to explicitly say "use a.out from the current directory", like this:
Code:
./a.out
 
Old 11-07-2007, 10:16 AM   #3
lifeafterdeath
Member
 
Registered: Oct 2007
Location: Bangalore, India
Distribution: SUSE 10.1 SP1, Fedora 7, Fedora 8, Ubuntu 8.04, Ubuntu 9.04
Posts: 65

Original Poster
Rep: Reputation: 15
Thanx a lot. Worked like a charm. Thank you very much.
 
  


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
problem compiling first qt/kde program Indiestory Programming 2 02-16-2007 03:00 PM
problem with compiling program Nocker Linux - Newbie 2 05-30-2006 11:28 AM
problem while compiling a lex program sam_cit Linux - Software 1 02-21-2006 03:59 AM
Problem with compiling my program. Zeth_htp Linux - Newbie 4 04-04-2003 10:12 PM
QT3 Problem when compiling a program PaladinCowboy75 Linux - Software 0 10-23-2002 09:53 PM


All times are GMT -5. The time now is 10:27 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