Ok, I’ve been struggling for hours now trying to figure out why my program will not compile so I thought I’d post here to see if someone has run into the same problem. I am attempting to get graphics interoperability integrated into my particle simulation and when I attempt to compile I get the following error. I am following the Particle example from the CUDA SDK and I don’t see that I am missing any header files. I have searched for a solution, both on this forum and outside and have yet to see my error. Any help is much appreciated. :)
1>CudaBuild:
1> Compiling CUDA source file main.cu...
1>
1> C:\Users\Santos\Documents\Visual Studio 2010\Projects\CUDA_SPH\CUDA_OpenGL>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3.2\bin\nvcc.exe" -gencode=arch=compute_20,code=\"sm_20,compute_20\" --use-local-env --cl-version 2008 -ccbin "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3.2\include" -G0 --keep-dir "Debug\" -maxrregcount=32 --machine 32 --compile -D_NEXUS_DEBUG -g -Xcompiler "/EHsc /nologo /Od /Zi /MDd " -o "Debug\main.obj" "C:\Users\Santos\Documents\Visual Studio 2010\Projects\CUDA_SPH\CUDA_OpenGL\main.cu"
1> main.cu
1>C:/Users/Santos/Documents/Visual Studio 2010/Projects/CUDA_SPH/CUDA_OpenGL/main.cu(500): error : identifier "glGenBuffers" is undefined
1>
1>C:/Users/Santos/Documents/Visual Studio 2010/Projects/CUDA_SPH/CUDA_OpenGL/main.cu(501): error : identifier "GL_ARRAY_BUFFER" is undefined
1>
1>C:/Users/Santos/Documents/Visual Studio 2010/Projects/CUDA_SPH/CUDA_OpenGL/main.cu(501): error : identifier "glBindBuffer" is undefined
1>
1>C:/Users/Santos/Documents/Visual Studio 2010/Projects/CUDA_SPH/CUDA_OpenGL/main.cu(502): error : identifier "GL_DYNAMIC_DRAW_ARB" is undefined
1>
1>C:/Users/Santos/Documents/Visual Studio 2010/Projects/CUDA_SPH/CUDA_OpenGL/main.cu(502): error : identifier "glBufferData" is undefined
1>
1> 5 errors detected in the compilation of "C:/Users/Santos/AppData/Local/Temp/tmpxft_0000095c_00000000-3_main.cpp1.ii".
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\CUDA 3.2.targets(272,3): error MSB3721: The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3.2\bin\nvcc.exe" -gencode=arch=compute_20,code=\"sm_20,compute_20\" --use-local-env --cl-version 2008 -ccbin "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3.2\include" -G0 --keep-dir "Debug\" -maxrregcount=32 --machine 32 --compile -D_NEXUS_DEBUG -g -Xcompiler "/EHsc /nologo /Od /Zi /MDd " -o "Debug\main.obj" "C:\Users\Santos\Documents\Visual Studio 2010\Projects\CUDA_SPH\CUDA_OpenGL\main.cu"" exited with code 2.
1>
1>Build FAILED.
I have the following #includes:
#ifndef _SPH_SYSTEM_H
#define _SPH_SYSTEM_H
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <string.h>
#ifndef _WIN_OPENGL_HEADERS
#define _WIN_OPENGL_HEADERS
#include <windows.h>
#include <GL\freeglut.h>
#endif
#ifndef _MATH_HEADERS
#define _MATH_HEADERS
#include <math.h>
#endif
#ifndef _CUDA_HEADERS
#define _CUDA_HEADERS
#include <cuda.h>
#include "cuda_runtime.h"
#include "cublas.h"
#include "cuda_gl_interop.h"
#include <vector_types.h>
#include <driver_types.h>
#endif