this is the program …when i build solution …an error has ocure
#ifndef GPU_ANIM_H
#define GPU_ANIM_H
#include “gl_helper.h”
#include “cuda_runtime.h”
#include “cuda.h”
#include “cuda_gl_interop.h”
#include
#include “device_launch_parameters.h”
#include<stdio.h>
using namespace std;
PFNGLBINDBUFFERARBPROC glBindBuffer = NULL;
PFNGLDELETEBUFFERSARBPROC glDeleteBuffers = NULL;
PFNGLGENBUFFERSARBPROC glGenBuffers = NULL;
PFNGLBUFFERDATAARBPROC glBufferData = NULL;
struct GPUAnimBitmap {
GLuint bufferObj;
cudaGraphicsResource *resource;
int width, height;
void dataBlock;
void (fAnim)(uchar4,void,int);
void (animExit)(void);
void (clickDrag)(void,int,int,int,int);
int dragStartX, dragStartY;
GPUAnimBitmap( int w, int h, void *d = NULL ) {
width = w;
height = h;
dataBlock = d;
clickDrag = NULL;
// first, find a CUDA device and set it to graphic interop
cudaDeviceProp prop;
int dev;
memset( &prop, 0, sizeof( cudaDeviceProp ) );
prop.major = 1;
prop.minor = 0;
cudaChooseDevice( &dev, &prop );
cudaGLSetGLDevice( dev );
// a bug in the Windows GLUT implementation prevents us from
// passing zero arguments to glutInit()
int c=1;
char* dummy = "";
glutInit( &c, &dummy );
glutInitDisplayMode( GLUT_DOUBLE | GLUT_RGBA );
glutInitWindowSize( width, height );
glutCreateWindow( "bitmap" );
glBindBuffer = (PFNGLBINDBUFFERARBPROC)GET_PROC_ADDRESS("glBindBuffer");
glDeleteBuffers = (PFNGLDELETEBUFFERSARBPROC)GET_PROC_ADDRESS("glDeleteBuffers");
glGenBuffers = (PFNGLGENBUFFERSARBPROC)GET_PROC_ADDRESS("glGenBuffers");
glBufferData = (PFNGLBUFFERDATAARBPROC)GET_PROC_ADDRESS("glBufferData");
glGenBuffers( 1, &bufferObj );
glBindBuffer( GL_PIXEL_UNPACK_BUFFER_ARB, bufferObj );
glBufferData( GL_PIXEL_UNPACK_BUFFER_ARB, width * height * 4,
NULL, GL_DYNAMIC_DRAW_ARB );
cudaGraphicsGLRegisterBuffer( &resource, bufferObj, cudaGraphicsMapFlagsNone );
}
~GPUAnimBitmap() {
free_resources();
}
void free_resources( void ) {
cudaGraphicsUnregisterResource( resource ) ;
glBindBuffer( GL_PIXEL_UNPACK_BUFFER_ARB, 0 );
glDeleteBuffers( 1, &bufferObj );
}
long image_size( void ) const { return width * height * 4; }
void click_drag( void (*f)(void*,int,int,int,int)) {
clickDrag = f;
}
void anim_and_exit( void (*f)(uchar4*,void*,int), void(*e)(void*) ) {
GPUAnimBitmap** bitmap = get_bitmap_ptr();
*bitmap = this;
fAnim = f;
animExit = e;
glutKeyboardFunc( Key );
glutDisplayFunc( Draw );
if (clickDrag != NULL)
glutMouseFunc( mouse_func );
glutIdleFunc( idle_func );
glutMainLoop();
}
error…
------ Build started: Project: A9, Configuration: Debug Win32 ------
1>Build started 19/08/2016 4:12:40 PM.
1>InitializeBuildStatus:
1> Touching “Debug\A9.unsuccessfulbuild”.
1>AddCudaCompileDeps:
1>Skipping target “AddCudaCompileDeps” because all output files are up-to-date with respect to the input files.
1>AddCudaCompilePropsDeps:
1>Skipping target “AddCudaCompilePropsDeps” because all output files are up-to-date with respect to the input files.
1>CudaBuild:
1>Skipping target “CudaBuild” because all output files are up-to-date with respect to the input files.
1>LINK : fatal error LNK1561: entry point must be defined
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.66
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
what is fatal error in this program …pls help me