Sorry for new thread but other thread was getting off topic....
I installed glut as like the readme.txt file said:
* Put the .dll in system32 directory
* put the .h file in "CodeBlocks\MinGW\include" and "CodeBlocks\MinGW\include\GL"
* put the .lib "CodeBlocks\MinGW\lib"
/* Using the standard output for fprintf */
#include <stdio.h>
#include <stdlib.h>
/* Use glew.h instead of gl.h to get all the GL prototypes declared */
#include <glew.h>
/* Using the GLUT library for the base windowing setup */
#include <glut.h>
/* ADD GLOBAL VARIABLES HERE LATER */
int init_resources(void)
{
/* FILLED IN LATER */
return 1;
}
void onDisplay()
{
/* FILLED IN LATER */
}
void free_resources()
{
/* FILLED IN LATER */
}
int main(int argc, char* argv[])
{
/* Glut-related initialising functions */
glutInit(&argc, argv);
glutInitContextVersion(2,0);
glutInitDisplayMode(GLUT_RGBA|GLUT_DOUBLE|GLUT_DEPTH);
glutInitWindowSize(640, 480);
glutCreateWindow("My First Triangle");
/* Extension wrangler initialising */
GLenum glew_status = glewInit();
if (glew_status != GLEW_OK)
{
fprintf(stderr, "Error: %s\n", glewGetErrorString(glew_status));
return EXIT_FAILURE;
}
/* When all init functions run without errors,
the program can initialise the resources */
if (1 == init_resources())
{
/* We can display it if everything goes OK */
glutDisplayFunc(onDisplay);
glutMainLoop();
}
/* If the program exits in the usual way,
free resources and exit with a success */
free_resources();
return EXIT_SUCCESS;
}
I would really like to know:
* If there is any way to simply copy and paste build errors like normal text, and if not, why the hell not?
* If the code I quoted above actually does work or not. (its from: http://en.wikibooks.org/wiki/OpenGL_Programming#The_basics_arc)
* If none of the above, what have the install instructions not said how to do?
Thanks, I went into the "linker" tab in build settings, clicked "add -> new" and then located the glut.lb where I installed it. The same errors as before still occur though. The errors are NOT in the code im using though, they are in "glut.h" (at least it opens those files when I run and goes to a certain point). Is it therefore the case that I downloaded a dodgy/not working version of GLUT?
As long as you're getting "undefined reference" errors, it means something isn't linking properly.
It's been a while since I worked with something other than pure OpenGL.
To install GLEW properly on windows for CodeBlocks:
1.) move "bin/glew32.dll" to "%SystemRoot%/system32"
2.) move "lib/glew32.lib" to "CodeBlocks/MinGW/lib"
3.) move "include/GL/glew.h" to "CodeBlocks/MinGW/include/GL"
4.) move "include/GL/wglew.h" to "CodeBlocks/MinGW/include/GL"
To install GLUT properly on windows for CodeBlocks:
1.) move "glut32.dll" to "%SystemRoot%/system32"
2.) move "glut.h" to "CodeBlocks/MinGW/include/GL"
3.) move "glut32.lib" to "CodeBlocks/MinGW/lib"
And then, of course, you need to add linker dependencies for both libraries.