Undefined symbols for architecture x86_64:
"_glewGetErrorString", referenced from:
_main in triangle-763e45.o
"_glewInit", referenced from:
_main in triangle-763e45.o
"_glutCreateWindow", referenced from:
_main in triangle-763e45.o
"_glutDisplayFunc", referenced from:
_main in triangle-763e45.o
"_glutInit", referenced from:
_main in triangle-763e45.o
"_glutInitContextVersion", referenced from:
_main in triangle-763e45.o
"_glutInitDisplayMode", referenced from:
_main in triangle-763e45.o
"_glutInitWindowSize", referenced from:
_main in triangle-763e45.o
"_glutMainLoop", referenced from:
_main in triangle-763e45.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
What do I have to do to compile this file? I do have the files freeglut.h and glew.h in the directory GL.
I am now compiling with:
g++ -framework GLUT -framework OpenGL -framework Cocoa triangle.cpp -o triangle
Now the output is reduced to
1 2 3 4 5 6 7 8
Undefined symbols for architecture x86_64:
"_glewGetErrorString", referenced from:
_main in triangle-d85427.o
"_glewInit", referenced from:
_main in triangle-d85427.o
"_glutInitContextVersion", referenced from:
_main in triangle-d85427.o
ld: symbol(s) not found for architecture x86_64