LinuxQuestions.org
Visit Jeremy's Blog.
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 09-15-2009, 10:41 AM   #1
prade
LQ Newbie
 
Registered: Sep 2009
Posts: 3

Rep: Reputation: 0
Smile help in compilin c++ codes on fedora 7


hi,
i am using fedora 7 & used to compile n run only c codes.
I am not able to run c++ code.I have tried various commands viz
c++ filename.cpp & g++ filename.cpp but neither of them worked.
please help me with this problem......waiting for reply
thank u
 
Old 09-15-2009, 11:00 AM   #2
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
What exactly do you mean "neither of them worked"? Were there error messages? If so, can you post them please. Also, for the sake of my curiosity, can you say why you didn't post the error message in the first place? Do you expect us to know the answer with so little information?
 
Old 09-15-2009, 11:04 AM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 19,075

Rep: Reputation: 4377Reputation: 4377Reputation: 4377Reputation: 4377Reputation: 4377Reputation: 4377Reputation: 4377Reputation: 4377Reputation: 4377Reputation: 4377Reputation: 4377
Quote:
Originally Posted by prade View Post
hi,
i am using fedora 7 & used to compile n run only c codes.
I am not able to run c++ code.I have tried various commands viz
c++ filename.cpp & g++ filename.cpp but neither of them worked.
please help me with this problem......waiting for reply
thank u

Also, spell out your words, please. And why are you using Fedora 7?? The latest is Fedora 11....
 
Old 09-15-2009, 11:10 AM   #4
prade
LQ Newbie
 
Registered: Sep 2009
Posts: 3

Original Poster
Rep: Reputation: 0
hi,
i know it was is a totally dubm of me to use f7 ....but anyway..when i use c++ or g++ i get a message bash g++ command not found please help
thank u
 
Old 09-15-2009, 11:13 AM   #5
prade
LQ Newbie
 
Registered: Sep 2009
Posts: 3

Original Poster
Rep: Reputation: 0
hi
i am new to linux got no idea which is new version... i get error messages like
bash g++ command not found please help
 
Old 09-15-2009, 12:59 PM   #6
archlinux_jessica
Member
 
Registered: Aug 2009
Location: PA USA
Distribution: Arch Linux
Posts: 78

Rep: Reputation: 19
g++

g++ is what your looking for, but you don't have it installed in your system.

You can update your Fedora to a newer version if you are new to Linux, even if that doesn't exactly solve the issue.

But to solve the issue you will need to install g++.

http://www.linuxforums.org/forum/man...installed.html seems to state that you can install it by using "yum install gcc-c++"

This should work on Fedora 7 along with any newer version. If it doesn't, might be best to get a newer version of fedora by going to their home page at http://fedoraproject.org/ and get the latest iso images to install.
 
Old 09-15-2009, 09:37 PM   #7
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 19,075

Rep: Reputation: 4377Reputation: 4377Reputation: 4377Reputation: 4377Reputation: 4377Reputation: 4377Reputation: 4377Reputation: 4377Reputation: 4377Reputation: 4377Reputation: 4377
Quote:
Originally Posted by prade View Post
hi
i am new to linux got no idea which is new version... i get error messages like
bash g++ command not found please help
Yes...that's what you said before. Don't post follow-ups 3 minutes apart, please.

Google will tell you what the versions are, as will Distrowatch (http://distrowatch.com/). If you're missing G++, then install it. Google can help you with that, but don't get your hopes up. FC7 has been out of support for a VERY long time, so the online repos that could help (like archlinux_jessica suggested), may not even work, as they're probably gone.

Do a fresh installation of a current version. G++ either will be installed when you install the rest of the development tools, or you will be able to get it from an online repo, by doing what archlinux_jessica suggested. Right now, you're stuck. You'll probably have to compile and install a LOT from source, to get G++ working.
 
Old 09-16-2009, 12:32 AM   #8
RockyMarrone
LQ Newbie
 
Registered: Sep 2009
Posts: 8

Rep: Reputation: 0
I think that can be done

lets take an example u have SRC folder which contains .cc and .c
and u just want to compile the .c

u can write a makefile like this

TARGET = test
CC = gcc

CFLAGS = -g -c -Wall -Werror -O2 # what ever you want
DFLAGS = -D_LINUX # what ever you want

SRC = $(shell find $(SRC_PATH) -name '*.c')
OBJ = $(SRC:.c=.o)
INCLUDE = -I../inc/ # what ever you want

$(TARGET) : $(OBJ)
$(CC) -o $(TARGET) $(OBJ) # This should be with a tab (RULE)

.c.o:
$(CC) $(CFLAGS) $(DFLAGS) $(INCLUDE) $< -o $@ # This should be with a tab (RULE)

i think this should u r lookin for ........
its better if u can write a piece of code because code can explain better then
the 100's of lines
 
Old 09-16-2009, 01:53 AM   #9
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Quote:
Originally Posted by RockyMarrone View Post
I think that can be done

lets take an example u have SRC folder which contains .cc and .c
and u just want to compile the .c

u can write a makefile like this
I'm not sure what relevance your post has to this thread. Perhaps this post was intended for a different thread? Be careful in future!
 
Old 09-16-2009, 02:37 AM   #10
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,168

Rep: Reputation: 2493Reputation: 2493Reputation: 2493Reputation: 2493Reputation: 2493Reputation: 2493Reputation: 2493Reputation: 2493Reputation: 2493Reputation: 2493Reputation: 2493
prade
PLEASE install fedora 11 .
fedora 7 HAS NO SUPPORT and the rpm's that need to be installed for fedora 7 don't exist any more ( except in the fedora historical archives)

then for fedora 11 you will need to install the devel tools
see
Code:
yum grouplist
-- and --
yum help
the groupinstall for fedora 11 will be something like this
( this WILL NOT WORK FOR FEDORA 7 )
Code:
su -
yum groupinstall "Development Tools" "Development Libraries" "GNOME Software Development"
 
  


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
Cheat Codes for Fedora 6 joao.m.esteves Fedora 1 12-03-2006 06:29 AM
Are the hex codes for colors in a jpg the same codes as used in html? abefroman Linux - Security 3 07-31-2005 03:21 PM
How to compile and run C codes in Fedora Core? hoper Programming 1 11-03-2004 01:53 PM
Problem when compilin C++ programs Ving Programming 3 10-26-2004 05:37 PM
problem compilin hermes graphic library 1.3.2 freeindy Linux - Software 0 12-27-2003 09:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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