 |
 |
using a c++ class
|
 |
|
 |
|
Mac Enthusiast
Join Date: Jan 2001
Status:
Offline
|
|
I'm working on an openGL game (using GLUT), and have a quick question...
what do I have to do to use a c++ class, for example, i want to define a box class - so i create a new c++ file, type all the necessary code - but when i try to instantiate a new box object from my main code, it says that the type is not defined.
do i have to include the class file in some way?
(its my first time with c++, but I know that the code is all correct)
thanks
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jan 2001
Location: Areas 51 thru 55 :P
Status:
Offline
|
|
I am assuming that you created both a Box.h and a Box.cc file (declaration and definition files). If not, well, you're gonna have to.
In main.cc, do a #include "Box.h" and you should be good to go.
|
|
Well, let's just say, 'if your VCR is still blinking 12:00,you don't want Linux'
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Feb 2001
Location: Rochester, uk
Status:
Offline
|
|
More generally, any good would tell you that, so if you haven't got a good book, get one.
I'm currently reading "Practical C++" (from, i think, Que) and it seems pretty good.
|
|
All words are lies. Including these ones.
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Jan 2001
Status:
Offline
|
|
thanks, ill pick up that book...
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jan 2001
Location: Areas 51 thru 55 :P
Status:
Offline
|
|
Originally posted by sadie:
<STRONG>More generally, any good would tell you that, so if you haven't got a good book, get one.
I'm currently reading "Practical C++" (from, i think, Que) and it seems pretty good.</STRONG>
My personal fav is "Thinking in C++".
If you plan on doing a lot of C++ development you may want to think about *eventually* getting a copy of John Lakos' book "Large Scale C++ Software Design" or something like that.
|
|
Well, let's just say, 'if your VCR is still blinking 12:00,you don't want Linux'
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|