Sign in to follow this  

Beginning OpenGL chapter 2 problem

This topic is 4377 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Using Dev-C++ 4.9.9.2, i tried to compile the source code from chapter 2, but received several errors, the most important one is in uppercase. Here are the libraries that i've linked with the project: -lglut32 -lglu32 -lopengl32 -lwinmm -lgdi32 I think i have to link the cgfxopengl.h file with the project but i'm not sure how. If anyone has any helpful ideas i would greatly appreciate it. line 8 CGFXOPENGL.H NO SUCH FILE OR DIRECTORY line 17 expected constructor, destructor, or type conversion before '*' token line 17 expected ',' o r';' before '*' token line 82 'g_glRender' undeclared

Share this post


Link to post
Share on other sites
#include <cgfxopengl.h> if it's in one of the directories set in the compiler's list of directories to search for headers or #include "cgfxopengl.h" if it's in the same directory as the project. There may also be a cgfxopengl.cpp or .lib that you may need to include in your project or link with. Hope that helps.

-AJ

Share this post


Link to post
Share on other sites
Here is the beginning of the source code. I've been searching for the *.lib file for it but haven't found anything. Also, does anyone know where i can get the glaux.h file?


#define WIN32_LEAN_AND_MEAN
#define WIN32_EXTRA_LEAN

#include <windows.h>
#include <gl/gl.h>
#include <gl/glu.h>

#include "CGfxOpenGL.h"

bool exiting = false;
long windowWidth = 800;
long windowHeight = 600;
long windowBits = 32;
bool fullscreen = false;
HDC hDC;

CGfxOpenGL *g_glRender = NULL;

Share this post


Link to post
Share on other sites
First, search for CGfxOpenGL.h and make sure it is in at least one of two places: one of the directories listed in the dialog box accessed by clicking Tools->Compiler Options->Directores(under include directories in the tabs within the dialog) or the same directory as the project. Second, since there's an instantiation of CGfxOpenGL as an object, it leads me to believe there's a CGfxOpenGL.cpp file somewhere that also needs to be included in your project, though that isn't necessarily true, but it makes sense. So look for that and report back on your results.

-AJ

Share this post


Link to post
Share on other sites
i followed your directions and put the cgfxopengl.h file in the correct sub folder. I also found the cgfxopengl.cpp file. I tried to compile the source code and dev is no longer having a problem with the library :) but it is now having a link error with specific actions associated with CGfxOpenGL :( (not sure of technical term.) Here are some of the errors.

[linker error] undefined reference to 'CGfxOpenGL::SetupProjection(int, int)'
[linker error] undefined reference to 'CGfxOpenGL::CGfxOpenGL()'
[linker error] undefined reference to 'CGfxOpenGL::Init()'
[linker error] undefined reference to 'CGfxOpenGL::Prepare(float)'
[linker error] undefined reference to 'CGfxOpenGL::Render()'

I took a c++ class last year, and a month or two ago i got into basic4gl. I decided to get the Opengl book to learn OpenGL with c++ and for the past day or two i've spent more time trying to download the correct file and find the right tutorials on setting everything up than i have spent on actually learning some of the material. I guess i'm trying to say that things would have been easier if the begginers opengl book or cd actually explained the setup process. Thanks for your help u325. :)

[Edited by - Shaku22 on December 18, 2005 2:16:01 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by Shaku22
i followed your directions and put the cgfxopengl.h file in the correct sub folder. I also found the cgfxopengl.cpp file. I tried to compile the source code and dev is no longer having a problem with the library :) but it is now having a link error with specific actions associated with CGfxOpenGL


Did you add the "cgfxopengl.cpp" file to your project? If so, make sure those are not functions that you must provided. Look for the keyword 'virtual' in the header file to see if this is the case.

Share this post


Link to post
Share on other sites
For me it was as simple as copying the folder with the project and source onto the C drive somewhere and going to file/import in DevCpp and loading up the Visual studio project file.

Share this post


Link to post
Share on other sites

This topic is 4377 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this