User forums > Help
How do you fully install opengl???
crinkle:
I can make a new opengl project just fine, and it brings up the default code with the spinny triangle. So i thought all was well, then i tried pasting some code in from one of these places and got all sorts of errors:
I have tried:
http://en.wikibooks.org/wiki/OpenGL_Programming#The_basics_arc
and
http://www.arcsynthesis.org/gltut/
Every bit of code on those gives a whole bunch of errors, reinstalling codeblocks didnt help, whats the matter?
stahta01:
Since you are keeping the errors a secret; we have to assume you are the problem.
NOTE: The next likely candidate is your compiler setup or library installation.
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F
Tim S.
crinkle:
Oh I am a big turnip!
Ok heres the code:
--- Code: ---/* 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;
}
--- End code ---
and here are the errors: http://imgur.com/H2R00O9
(isnt there a way to just COPY AND PASTE the darn text from the build messages screen????????)
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"
Restarted program and the code, and it gives those errors...
oBFusCATed:
--- Quote from: crinkle on June 08, 2014, 04:48:46 pm ---(isnt there a way to just COPY AND PASTE the darn text from the build messages screen????????)
--- End quote ---
Of course there is -> right click copy to clipboard or copy selection to clipboard...
crinkle:
when you click or even "hold-click" on a line, it highlights it all and then the main editor goes to whatever part of your code has the problem... its not selectable text.
Navigation
[0] Message Index
[#] Next page
Go to full version