I have seen 2 posts with this same question but one was with visual studio and the other didn't work so here goes. i am attempting to compile the first source code that comes with the opening bible 5th edition...but i am trying to do so with the code::blocks ide. i thought i had freeglut installed correctly(as i can run the glut program that comes with C::B) but i am getting numerous errors from glut and glu...and after i thought i fixed those problems now im getting over 50 error and i have no idea what is causing them. the error look like this
obj\Debug\main.o(.text+0x2eb):C:\Users|20|undefined reference to `GLShaderManager::~GLShaderManager()'|
C:\Users\t\main.cpp|27|undefined reference to
glViewport@16'|`
all the error are very similar but the undefined reference changes to another OpenGL function.
any help would be appreciated and just ask if you need the source code or more error.
EDIT
after adding glu32 to the linker it got rid of all error regarding that but there appear to be a problem with my freeglut installation i am getting errorobj\Debug\main.o(.text+0x1c)||In function `glutInit_ATEXIT_HACK':|
freeglut_std.h|610|undefined reference to `_imp____glutInitWithExit@12'|
obj\Debug\main.o(.text+0x3f)||In function `glutCreateWindow_ATEXIT_HACK':|
freeglut_std.h|612|undefined reference to `_imp____glutCreateWindowWithExit@8'|
obj\Debug\main.o(.text+0x61)||In function `glutCreateMenu_ATEXIT_HACK':|
freeglut_std.h|614|undefined reference to `_imp____glutCreateMenuWithExit@8'|
solved free glut problem...i had to use different library files.... i got them from here
Edit 2
i got freeglut worki开发者_如何学JAVAng by now the custom library that the book used is giving me an error...i belive this is becouse i am attempting to use a .lib file (which is what it came as) this might have been the source of all my errors...can C::B link .lib files or does it only take .a and .o files for library?You have to add proper libraries to link against with.
For C::B,
- Go to Project
- Select Build Option
- Select Linkers
- Add OpenGL, Glu32 libraries to your project.
Response to your EDIT:
Follow the steps in here: http://www.sci.brooklyn.cuny.edu/~goetz/codeblocks/glut/
精彩评论