Created
September 26, 2015 14:51
-
-
Save prp-e/e250b3f1318a696c65fa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <GL/freeglut.h> | |
#include <GL/glu.h> | |
#include <GL/glut.h> | |
#include <GL/gl.h> | |
void display() { | |
glClear(GL_COLOR_BUFFER_BIT); | |
glBegin(GL_POLYGON); | |
glVertex2f(-0.5, -0.5); | |
glVertex2f(-0.5, 0.5); | |
glVertex2f(0.5, 0.5); | |
glVertex2f(0.5, -0.5); | |
glEnd(); | |
glFlush(); | |
} | |
int main(int argc, char** argv){ | |
glutInit(&argc, argv); | |
glutCreateWindow("Hello, Square"); | |
glutDisplayFunc(display); | |
glutMainLoop(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
/tmp/ccjA7KCD.o: In function
display()': 1.cpp:(.text+0xa): undefined reference to
glClear'1.cpp:(.text+0x14): undefined reference to
glBegin' 1.cpp:(.text+0x29): undefined reference to
glVertex2f'1.cpp:(.text+0x3e): undefined reference to
glVertex2f' 1.cpp:(.text+0x53): undefined reference to
glVertex2f'1.cpp:(.text+0x68): undefined reference to
glVertex2f' 1.cpp:(.text+0x6d): undefined reference to
glEnd'1.cpp:(.text+0x72): undefined reference to
glFlush' /tmp/ccjA7KCD.o: In function
main':1.cpp:(.text+0x96): undefined reference to
glutInit' 1.cpp:(.text+0xa0): undefined reference to
glutCreateWindow'1.cpp:(.text+0xaa): undefined reference to
glutDisplayFunc' 1.cpp:(.text+0xaf): undefined reference to
glutMainLoop'collect2: error: ld returned 1 exit status