From: Thomas Lionel SMETS <tsmets@altern.org>
To: help-gcc@gnu.org
Subject: Classes in multiple files
Date: Mon, 03 Jan 2000 15:25:00 -0000 [thread overview]
Message-ID: <38712C84.AFD15365@altern.org> (raw)
Well the question should have a rather straight answer but I do know how
to do it, so ...
I wish to have two classes in two separated files, as such :
============== B E G I N O F F I L E 1 ====================
#include ... // Only standart header files <iostream>, etc ...
class ClassName1 {
// Implementation
}
============== E N D O F F I L E 1 =======================
============== B E G I N O F F I L E 2 ====================
#include ... // Only standart header files <iostream>, etc ...
class ClassName2 : class ClassName1 {
// Implementation
}
int main() {
// Implementation of pgrm
}
============== E N D O F F I L E 2 =======================
Now the question is :
How do I compile this properly ?
Currently my make file is, as such :
============= Begin of Make File ===================
ClassName1 : ClassName1.cpp
g++ ClassName1.cpp -o ClassName1
ClassName2 : ClassName2.cpp ClassName1.o
g++ ClassName2.cpp ClassName1.o -o ClassName2
ClassName1.o : ClassName1.cpp
g++ -c ClassName1.cpp
============= End of Make File ===================
As I don't know how to make Header files for other thiings than C
function --> there is no Header file comin' from my code. Secondly ... I
don't link the ".o" files ... Maybe it's a mistake ?
A kind answer would be appreciated :-) !
Thanks in advance,
Thomas,
--
mail : thomas.smets@gonthier-be.com (professionnel)
tsmets@altern.org (privé)
WARNING: multiple messages have this Message-ID
From: Thomas Lionel SMETS <tsmets@altern.org>
To: help-gcc@gnu.org
Subject: Classes in multiple files
Date: Sat, 01 Apr 2000 00:00:00 -0000 [thread overview]
Message-ID: <38712C84.AFD15365@altern.org> (raw)
Message-ID: <20000401000000.z08ouWXTfNGtR1SRQj_ZxZhJz5THdXXjh2mEUMJUxTA@z> (raw)
Well the question should have a rather straight answer but I do know how
to do it, so ...
I wish to have two classes in two separated files, as such :
============== B E G I N O F F I L E 1 ====================
#include ... // Only standart header files <iostream>, etc ...
class ClassName1 {
// Implementation
}
============== E N D O F F I L E 1 =======================
============== B E G I N O F F I L E 2 ====================
#include ... // Only standart header files <iostream>, etc ...
class ClassName2 : class ClassName1 {
// Implementation
}
int main() {
// Implementation of pgrm
}
============== E N D O F F I L E 2 =======================
Now the question is :
How do I compile this properly ?
Currently my make file is, as such :
============= Begin of Make File ===================
ClassName1 : ClassName1.cpp
g++ ClassName1.cpp -o ClassName1
ClassName2 : ClassName2.cpp ClassName1.o
g++ ClassName2.cpp ClassName1.o -o ClassName2
ClassName1.o : ClassName1.cpp
g++ -c ClassName1.cpp
============= End of Make File ===================
As I don't know how to make Header files for other thiings than C
function --> there is no Header file comin' from my code. Secondly ... I
don't link the ".o" files ... Maybe it's a mistake ?
A kind answer would be appreciated :-) !
Thanks in advance,
Thomas,
--
mail : thomas.smets@gonthier-be.com (professionnel)
tsmets@altern.org (privé)
next reply other threads:[~2000-01-03 15:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-01-03 15:25 Thomas Lionel SMETS [this message]
2000-01-05 15:04 ` David C. Fox
2000-04-01 0:00 ` David C. Fox
2000-04-01 0:00 ` Thomas Lionel SMETS
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=38712C84.AFD15365@altern.org \
--to=tsmets@altern.org \
--cc=help-gcc@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).