LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-22-2005, 07:15 AM   #1
seran
Member
 
Registered: Aug 2004
Location: Bangalore
Posts: 64

Rep: Reputation: 16
g++ is not compiling


Hello,
I have a RedHat 8.0 box with no development tools installed( no compilers and debuggers). I wanted to compile some C programs in my machine, so downloaded gcc-g++-2.95.2-2.i386.rpm and installed it. After installing g++ I tried to compile a simple "HelloWorld" program. g++ didnt compile the program and it gave the following error message on the terminal.

$ g++ hello.c
<command line>:1:13: warning: "system" re-asserted
<command line>:1:9: warning: "cpu" re-asserted
<command line>:1:13: warning: "machine" re-asserted
hello.c:1:19: stdio.h: No such file or directory

'which g++' gave /usr/bin/g++. I did some search, but couldnt solve the problem. How to make my C program work? Did I missed anything?
 
Old 08-22-2005, 07:21 AM   #2
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
Did you install the regular gcc package as well? Why are you compiling a C program with g++? g++ invokes the C++ compiler for gcc... just use regular old gcc if your writing a C program.
 
Old 08-22-2005, 07:32 AM   #3
seran
Member
 
Registered: Aug 2004
Location: Bangalore
Posts: 64

Original Poster
Rep: Reputation: 16
I did not install a gcc package. I will install and then try to compile. thanks for ur suggestion.
 
Old 08-22-2005, 08:06 AM   #4
seran
Member
 
Registered: Aug 2004
Location: Bangalore
Posts: 64

Original Poster
Rep: Reputation: 16
I did an upgrade for Development tools using my RedHat Linux installation CD's. Now I am able to compile my programs. Now everything works fine. I feel ashamed for my mistake.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Various Compiling Errors (GCC compiling Openal, GUIlib, xmms-wma) gregorya Linux - Software 2 08-27-2004 05:03 AM
Compiling in ACPI support on Compaq 2135CA (system crashes while compiling) Dag Linux - Laptop and Netbook 20 07-30-2004 07:56 PM
Compiling....... chilehead Linux - Software 6 11-03-2003 03:11 PM
Kernel compiling and module compiling tarballed Linux - General 1 12-22-2002 05:31 PM
compiling how-to?? crashmeister LQ Suggestions & Feedback 7 12-11-2002 10:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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