それで、私はhttp://ogldev.atspace.co.uk/www/tutorial02/tutorial02.htmlを読んでいて、Vector3f には math_3d.h が必要だと言いました。
私はそれを含めようとしました:
#include <stdio.h>
#include "GL/glew.h"
#include "GL/gl.h"
#include "GL/freeglut.h"
#include "math_3d.h"
void render() {
glClearColor(0.0, 0.0, 0.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
glutSwapBuffers();
glFlush();
}
int main(int argc, char** argv) {
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA);
glutInitWindowSize(800, 600);
glutInitWindowPosition(100, 100);
glutCreateWindow("OpenGL - First window demo");
/* Set */
GLenum res = glewInit();
if (res != GLEW_OK) {
fprintf(stderr, "Error: '%s'\n", glewGetErrorString(res));
return 1;
}
Vector3f vertices[1];
glutDisplayFunc(render);
glutMainLoop();
return 0;
}
G++ は、「main.cpp:7:21: 致命的なエラー: math_3d.h: そのようなファイルまたはディレクトリはありません」と言っていました。そのための Arch Linux パッケージを探しましたが、何も見つかりませんでした。
ここでファイルを見つけました:
http://ogldev.googlecode.com/svn-history/r75/trunk/tutorial36/math_3d.h
そのファイルをダウンロードしてプロジェクト ディレクトリに配置する必要がありますか、それともよりクリーンな方法がありますか?
また、ディレクトリに含める場合、どうすれば g++ 行に追加できますか?
gcc main.cpp -o main -lGLEW -lglut -lGL