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 02-09-2006, 08:09 PM   #1
mmattax
LQ Newbie
 
Registered: Feb 2006
Posts: 14

Rep: Reputation: 0
compiling c code in SuSe 10 ?!


I just made the switch to Linux and am trying to figure out how to compile some c code that I have programmed

how can I simply compile and execute a .c file? I'm trying to test a simple hello world program but am having no luck.

I have tried in the terminal: gcc -0 helloworld hello.c

but the terminal seems to not reconize gcc command, what am I doing wrong?

Also will openGL commands work when compiling in linux?

Thanks.
 
Old 02-09-2006, 08:21 PM   #2
pdeman2
Member
 
Registered: Jul 2005
Location: Maine, USA
Distribution: OpenSUSE, Gentoo, Fedora, Ubuntu, Mandriva, others
Posts: 413

Rep: Reputation: 30
Perhaps you did not cd into the directory the hello.c file was in. It might also be helpful to give the output of the gcc command.
 
Old 02-09-2006, 08:31 PM   #3
mmattax
LQ Newbie
 
Registered: Feb 2006
Posts: 14

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pdeman2
Perhaps you did not cd into the directory the hello.c file was in. It might also be helpful to give the output of the gcc command.

michael@linux:~> ls
bin Desktop Documents My Music public_html test.c
michael@linux:~> gcc -o hello test.c
bash: gcc: command not found
michael@linux:~>
 
Old 02-09-2006, 08:39 PM   #4
pdeman2
Member
 
Registered: Jul 2005
Location: Maine, USA
Distribution: OpenSUSE, Gentoo, Fedora, Ubuntu, Mandriva, others
Posts: 413

Rep: Reputation: 30
Try typing whereis gcc and see what the output is.
 
Old 02-09-2006, 08:40 PM   #5
amosf
Senior Member
 
Registered: Jun 2004
Location: Australia
Distribution: Mandriva/Slack - KDE
Posts: 1,672

Rep: Reputation: 46
Maybe you need to install the compiler. That usually helps.
 
Old 02-09-2006, 08:42 PM   #6
mmattax
LQ Newbie
 
Registered: Feb 2006
Posts: 14

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by amosf
Maybe you need to install the compiler. That usually helps.
im a complete noob, how do I do that?
 
Old 02-09-2006, 08:43 PM   #7
mmattax
LQ Newbie
 
Registered: Feb 2006
Posts: 14

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pdeman2
Try typing whereis gcc and see what the output is.
michael@linux:~> whereis gcc
gcc: /usr/lib/gcc
michael@linux:~>
 
Old 02-09-2006, 08:58 PM   #8
amosf
Senior Member
 
Registered: Jun 2004
Location: Australia
Distribution: Mandriva/Slack - KDE
Posts: 1,672

Rep: Reputation: 46
you'll need to use yast and install the compiler and development apps...
 
  


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
compiling C code vose Programming 29 10-08-2004 08:28 AM
Compiling C code with libraries OldGuru Programming 4 09-18-2004 08:06 PM
Help compiling code for install jagrom Linux - Newbie 9 09-04-2004 09:15 AM
Compiling Kernel Code vbhatia_81 Programming 1 06-21-2004 07:53 AM
compiling code ripmaster Linux - Software 2 03-06-2004 10:07 PM


All times are GMT -5. The time now is 10:27 AM.

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