Saludos estaba empesando con opengl y tengo probelmas para compilar el primer ejemplo.
codigo que estoy usando
// Include standard headers
#include <stdio.h>
#include <stdlib.h>
// Include GLEW
#include <GL/glew.h>
// Include GLFW
#include <GL/glfw.h>
// Include GLM
#include <glm/glm.hpp>
using namespace glm;
int main( void )
{
// Initialise GLFW
if( !glfwInit() )
{
fprintf( stderr
, "Failed to initialize GLFW\n" ); return -1;
}
glfwOpenWindowHint(GLFW_FSAA_SAMPLES, 4);
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3);
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 3);
glfwOpenWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
// Open a window and create its OpenGL context
if( !glfwOpenWindow( 1024, 768, 0,0,0,0, 32,0, GLFW_WINDOW ) )
{
fprintf( stderr
, "Failed to open GLFW window. If you have an Intel GPU, they are not 3.3 compatible. Try the 2.1 version of the tutorials.\n" ); glfwTerminate();
return -1;
}
// Initialize GLEW
if (glewInit() != GLEW_OK) {
fprintf(stderr
, "Failed to initialize GLEW\n"); return -1;
}
glfwSetWindowTitle( "Tutorial 01" );
// Ensure we can capture the escape key being pressed below
glfwEnable( GLFW_STICKY_KEYS );
// Dark blue background
glClearColor(0.0f, 0.0f, 0.3f, 0.0f);
do{
// Draw nothing, see you in tutorial 2 !
// Swap buffers
glfwSwapBuffers();
} // Check if the ESC key was pressed or the window was closed
while( glfwGetKey( GLFW_KEY_ESC ) != GLFW_PRESS &&
glfwGetWindowParam( GLFW_OPENED ) );
// Close OpenGL window and terminate GLFW
glfwTerminate();
return 0;
}
g++ 1.cpp -I/usr/include -L/usr/lib -L/usr/lib64 -LGL -Lglew -Lglfw -Lglut
1.cpp: In function ‘int main()’:
1.cpp:25:21: error: ‘GLFW_OPENGL_VERSION_MAJOR’ was not declared in this scope
1.cpp:26:21: error: ‘GLFW_OPENGL_VERSION_MINOR’ was not declared in this scope
1.cpp:27:21: error: ‘GLFW_OPENGL_PROFILE’ was not declared in this scope
1.cpp:27:42: error: ‘GLFW_OPENGL_CORE_PROFILE’ was not declared in this scope
clang++ 1.cpp -I/usr/include -L/usr/lib -L/usr/lib64 -LGL -Lglew -Lglfw -Lglut
1.cpp:25:21: error: use of undeclared identifier 'GLFW_OPENGL_VERSION_MAJOR'
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3);
^
1.cpp:26:21: error: use of undeclared identifier 'GLFW_OPENGL_VERSION_MINOR'
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 3);
^
1.cpp:27:21: error: use of undeclared identifier 'GLFW_OPENGL_PROFILE'
glfwOpenWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
^
3 errors generated.
si pudieran ayudarme estaria agredecido.
estoy seguro de que glfw esta instalado, estoy usando gentoo.