这是我想在我的计算机上运行的c ++代码:http://pastebin.com/66BEyTWK
在大学计算机上,此代码显示白色方块.但是当我尝试在我的计算机上运行它时,我得到的只是一个空白屏幕.
我在opengl faq上读到问题可能是我正在使用错误的opengl库组合进行链接.
代码的一部分表明我需要链接glm,glew和freeglut.
#include <iostream>
#include <GL/glew.h>
#include <GL/freeglut.h>
#include <glm/glm.hpp>
Run Code Online (Sandbox Code Playgroud)
我读到没有必要链接glm,因为它只是一个头文件.所以这是我提出的编译语句:
g++ -o main white_square.cpp -lGL -lglut -lGLEW
Run Code Online (Sandbox Code Playgroud)
在我的大学,他们已经设置了一个自定义的makefile,我无法理解:http://pastebin.com/3DxST3Xs