I am receiving the following error:
Undefined symbols:
“DrawGLScene()”, referenced from:
__Z11DrawGLScenev$non_lazy_ptr in cc4pHIdQ.o
“InitGL()”, referenced from:
_main in cc4pHIdQ.o
“ReSizeGLScene(int, int)”, referenced from:
__Z13ReSizeGLSceneii$non_lazy_ptr in cc4pHIdQ.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
when trying to compile the following code
#include <OpenGL/gl.h> // Header File For The OpenGL32 Library
#include <OpenGL/glu.h> // Header File For The GLu32 Library
#include <GLUT/glut.h> // Header File For The GLut Library
#define kWindowWidth 400
#define kWindowHeight 300
GLvoid InitGL(GLvoid);
GLvoid DrawGLScene(GLvoid);
GLvoid ReSizeGLScene(int Width, int Height);
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize (kWindowWidth, kWindowHeight);
glutInitWindowPosition (100, 100);
glutCreateWindow (argv[0]);
InitGL();
glutDisplayFunc(DrawGLScene);
glutReshapeFunc(ReSizeGLScene);
glutMainLoop();
return 0;
}
Using the following command:
g++ opengltest.cpp -o test -framework OpenGL -framework GLUT
I can’t find any flags that I am missing. Any help is appreciated. Thanks!