1. 首先,编译环境说明:
Centos5.6 X86_64 (64位)
gcc 4.1.2
cuda 4.0
2. 进入路径,编译
[jliu@localhost chapter04]$ cd /media/disk/cuda_me/CUDA by example/chapter04
[jliu@localhost chapter04]$ nvcc julia_gpu.cu
在包含自 ../common/cpu_bitmap.h:20 的文件中,
从 julia_gpu.cu:18:
../common/gl_helper.h:44:21: 错误:GL/glut.h:没有那个文件或目录
[jliu@localhost chapter04]$
3. 查看../common/gl_helper.h:44
glut.h和glext.h在../common目录下,但glx.h是在标准库/usr/include/GL下(可用locate命令查找一下),可见头文件中的GL不是同一个。所以,将#include <GL/glut.h>和#include <GL/glext.h>更改为#include “GL/glut.h”和#include “GL/glext.h”即可。