Share your knowledge at the LQ Wiki.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 02-19-2004, 05:56 PM   #1
Registered: Oct 2003
Distribution: fedora cor 5 x86_64
Posts: 639

Rep: Reputation: 30
newbie c++ compiling class question

i have an assignment for school that i need to write a SavingsAccount class, how do i compile an external class?? i have these files already created


Old 02-19-2004, 07:17 PM   #2
LQ Newbie
Registered: Feb 2004
Posts: 2

Rep: Reputation: 0
gcc -c SavingsAccount.cpp
gcc -o SavingsAcctTest SavingsAcctTest.cpp SavingsAccount.o
Old 02-19-2004, 10:33 PM   #3
LQ Guru
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 48
Or just compile them all together:

gcc SavingsAccount.cpp SavingsAcctTest.cpp -o SavingsAcctTest
Old 02-20-2004, 04:47 PM   #4
Registered: Aug 2003
Location: DMZ
Distribution: Ubuntu
Posts: 144

Rep: Reputation: 15
Or make a makefile
Old 02-20-2004, 08:34 PM   #5
Registered: Sep 2003
Distribution: Slackware 10 w/ Kernel 2.6.8
Posts: 176

Rep: Reputation: 30
gr33ndata beat me to it

ummm using gcc on a .cpp file might give you an error so try g++.


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
C++ Compiling single class without a main() harshnoise Programming 4 08-29-2005 04:59 PM
(linking?) problem compiling very simple array class btb Programming 3 08-02-2005 03:16 PM
Kind of a newbie question On PHP compiling. Junior41180 Linux - Software 2 02-10-2005 09:01 PM
some question asked by a newbie compiling KDE3.2 tony yu Mandriva 2 02-15-2004 08:43 PM
newbie compiling and versions question glo Programming 3 07-30-2003 10:54 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:48 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration