Archived

This topic is now archived and is closed to further replies.

ichor

Where to DrawGLScene?

Recommended Posts

I''m having a couple problems drawing onto the screen... or even getting the code to compile. Right now, I have a main file, "world.cpp" and an Object "cube.cpp" file. The Cube.cpp file contains various things, including void drawCube(). I am trying to invoke this method from the world.cpp file, but have not been successfull. I call the drawCube like: world[j].drawCube(); Inside of: int DrawGLScene(GLvoid) I get this compile error: Linking... world.obj : error LNK2001: unresolved external symbol "public: void __thiscall Cube::drawCube(void)" (?drawCube@Cube@@QAEXXZ) What is causing this? Do I have to only draw things inside methods called DrawGLScene()? (This may sound like a dumb question, but my background is in Java, where paint() does pretty much all the work.) The code compiles file, but when I attempt to "Build.exe" I get that error. Please help!

Share this post


Link to post
Share on other sites
A guess...

sounds like you have added the drawCube function defintion to your class definition, but not added the function code, forgot the cube:: or mispelled it.

in your cube.cpp there must be a

void Cube::drawCube()
{
.....

??

Edited by - claus hansen ries on June 15, 2000 6:16:51 AM

Share this post


Link to post
Share on other sites
I have both the class declaration and the Cube::drawCube() methods there... And it''s called from the main file correctly... (I''m using VC++ 6.0, and it pops open a mini dialog and shows which methods are available for the object, and I selected from there.)

Anything else? =)

Share this post


Link to post
Share on other sites
if your code is short try post it...or a link to it...??

world.cpp cube.h cube.cpp

in world.cpp you include cube.h, which contain class definition
and in cube.cpp the is the Cube::draw... ??




Edited by - Claus Hansen Ries on June 15, 2000 6:44:32 AM

Share this post


Link to post
Share on other sites
ARRRGGGHHHH!!

Well, as I was pasting in several dozen lines of code, I realized that ALL of the class functions EXCEPT for drawCube() was preceded with Cube::

So, I made it Cube::drawCube() and now it works great.

Thanks for the help... I feel sorta dumb. hehehe =)

Share this post


Link to post
Share on other sites