cuda on microsoft visual 2005 problem...

Hi

I was running the demo projects that cuda skd has.

And I was using the template one to learn how to use cuda

so far until today I was experimenting on it and everything was ok.

but today on all demo projects…they run well but if i try to change any of the files and run again, I get this stupid error.

and I have to cut and paste a fresh copy of the projects to be able to run them again but as soon as I modify any file… i get the same thing again

and i go the lines in which the errors suppose to be, but the kind of error does not even make sense…for intance it says something about a variable “exit” but that variable does not even exists in the template.cu file

sorry about my english

1>------ Build started: Project: template, Configuration: Debug Win32 ------
1>Performing Custom Build Step
1>template.cu
1>“template.cu”, line 68: error: identifier “exit” is undefined
1> if (!cutCheckCmdLineFlag(argc, (const char**)argv, “noprompt”)) { printf("\nPress ENTER to exit…\n"); fflush( (&__iob_func()[1])); fflush( (&__iob_func()[2])); getchar(); } exit(0);;
1> ^
1>“template.cu”, line 78: error: identifier “exit” is undefined
1> do { int deviceCount; do { cudaError err = cudaGetDeviceCount(&deviceCount); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 78, cudaGetErrorString( err) ); exit(1); } } while (0); if (deviceCount == 0) { fprintf((&__iob_func()[2]), “There is no device.\n”); exit(1); } int dev; for (dev = 0; dev < deviceCount; ++dev) { cudaDeviceProp deviceProp; do { cudaError err = cudaGetDeviceProperties(&deviceProp, dev); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 78, cudaGetErrorString( err) ); exit(1); } } while (0); if (deviceProp.major >= 1) break; } if (dev == deviceCount) { fprintf((&__iob_func()[2]), “There is no device supporting CUDA.\n”); exit(1); } else do { do { cudaError err = cudaSetDevice(dev); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 78, cudaGetErrorString( err) ); exit(1); } } while (0); cudaError err = cudaThreadSynchronize(); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 78, cudaGetErrorString( err) ); exit(1); } } while (0); } while (0);
1> ^
1>“template.cu”, line 78: error: identifier “exit” is undefined
1> do { int deviceCount; do { cudaError err = cudaGetDeviceCount(&deviceCount); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 78, cudaGetErrorString( err) ); exit(1); } } while (0); if (deviceCount == 0) { fprintf((&__iob_func()[2]), “There is no device.\n”); exit(1); } int dev; for (dev = 0; dev < deviceCount; ++dev) { cudaDeviceProp deviceProp; do { cudaError err = cudaGetDeviceProperties(&deviceProp, dev); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 78, cudaGetErrorString( err) ); exit(1); } } while (0); if (deviceProp.major >= 1) break; } if (dev == deviceCount) { fprintf((&__iob_func()[2]), “There is no device supporting CUDA.\n”); exit(1); } else do { do { cudaError err = cudaSetDevice(dev); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 78, cudaGetErrorString( err) ); exit(1); } } while (0); cudaError err = cudaThreadSynchronize(); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 78, cudaGetErrorString( err) ); exit(1); } } while (0); } while (0);
1> ^
1>“template.cu”, line 78: error: identifier “exit” is undefined
1> do { int deviceCount; do { cudaError err = cudaGetDeviceCount(&deviceCount); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 78, cudaGetErrorString( err) ); exit(1); } } while (0); if (deviceCount == 0) { fprintf((&__iob_func()[2]), “There is no device.\n”); exit(1); } int dev; for (dev = 0; dev < deviceCount; ++dev) { cudaDeviceProp deviceProp; do { cudaError err = cudaGetDeviceProperties(&deviceProp, dev); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 78, cudaGetErrorString( err) ); exit(1); } } while (0); if (deviceProp.major >= 1) break; } if (dev == deviceCount) { fprintf((&__iob_func()[2]), “There is no device supporting CUDA.\n”); exit(1); } else do { do { cudaError err = cudaSetDevice(dev); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 78, cudaGetErrorString( err) ); exit(1); } } while (0); cudaError err = cudaThreadSynchronize(); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 78, cudaGetErrorString( err) ); exit(1); } } while (0); } while (0);
1> ^
1>“template.cu”, line 78: error: identifier “exit” is undefined
1> do { int deviceCount; do { cudaError err = cudaGetDeviceCount(&deviceCount); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 78, cudaGetErrorString( err) ); exit(1); } } while (0); if (deviceCount == 0) { fprintf((&__iob_func()[2]), “There is no device.\n”); exit(1); } int dev; for (dev = 0; dev < deviceCount; ++dev) { cudaDeviceProp deviceProp; do { cudaError err = cudaGetDeviceProperties(&deviceProp, dev); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 78, cudaGetErrorString( err) ); exit(1); } } while (0); if (deviceProp.major >= 1) break; } if (dev == deviceCount) { fprintf((&__iob_func()[2]), “There is no device supporting CUDA.\n”); exit(1); } else do { do { cudaError err = cudaSetDevice(dev); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 78, cudaGetErrorString( err) ); exit(1); } } while (0); cudaError err = cudaThreadSynchronize(); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 78, cudaGetErrorString( err) ); exit(1); } } while (0); } while (0);
1> ^
1>“template.cu”, line 78: error: identifier “exit” is undefined
1> do { int deviceCount; do { cudaError err = cudaGetDeviceCount(&deviceCount); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 78, cudaGetErrorString( err) ); exit(1); } } while (0); if (deviceCount == 0) { fprintf((&__iob_func()[2]), “There is no device.\n”); exit(1); } int dev; for (dev = 0; dev < deviceCount; ++dev) { cudaDeviceProp deviceProp; do { cudaError err = cudaGetDeviceProperties(&deviceProp, dev); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 78, cudaGetErrorString( err) ); exit(1); } } while (0); if (deviceProp.major >= 1) break; } if (dev == deviceCount) { fprintf((&__iob_func()[2]), “There is no device supporting CUDA.\n”); exit(1); } else do { do { cudaError err = cudaSetDevice(dev); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 78, cudaGetErrorString( err) ); exit(1); } } while (0); cudaError err = cudaThreadSynchronize(); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 78, cudaGetErrorString( err) ); exit(1); } } while (0); } while (0);
1> ^
1>“template.cu”, line 78: error: identifier “exit” is undefined
1> do { int deviceCount; do { cudaError err = cudaGetDeviceCount(&deviceCount); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 78, cudaGetErrorString( err) ); exit(1); } } while (0); if (deviceCount == 0) { fprintf((&__iob_func()[2]), “There is no device.\n”); exit(1); } int dev; for (dev = 0; dev < deviceCount; ++dev) { cudaDeviceProp deviceProp; do { cudaError err = cudaGetDeviceProperties(&deviceProp, dev); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 78, cudaGetErrorString( err) ); exit(1); } } while (0); if (deviceProp.major >= 1) break; } if (dev == deviceCount) { fprintf((&__iob_func()[2]), “There is no device supporting CUDA.\n”); exit(1); } else do { do { cudaError err = cudaSetDevice(dev); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 78, cudaGetErrorString( err) ); exit(1); } } while (0); cudaError err = cudaThreadSynchronize(); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 78, cudaGetErrorString( err) ); exit(1); } } while (0); } while (0);
1> ^
1>“template.cu”, line 81: error: identifier “exit” is undefined
1> if( CUTTrue != cutCreateTimer( &timer)) { fprintf((&__iob_func()[2]), “Cut error in file ‘%s’ in line %i.\n”, “template.cu”, 81); exit(1); };
1> ^
1>“template.cu”, line 82: error: identifier “exit” is undefined
1> if( CUTTrue != cutStartTimer( timer)) { fprintf((&__iob_func()[2]), “Cut error in file ‘%s’ in line %i.\n”, “template.cu”, 82); exit(1); };
1> ^
1>“template.cu”, line 97: error: identifier “exit” is undefined
1> do { do { cudaError err = cudaMalloc( (void**) &d_idata, mem_size); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 97, cudaGetErrorString( err) ); exit(1); } } while (0); cudaError err = cudaThreadSynchronize(); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 97, cudaGetErrorString( err) ); exit(1); } } while (0);
1> ^
1>“template.cu”, line 97: error: identifier “exit” is undefined
1> do { do { cudaError err = cudaMalloc( (void**) &d_idata, mem_size); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 97, cudaGetErrorString( err) ); exit(1); } } while (0); cudaError err = cudaThreadSynchronize(); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 97, cudaGetErrorString( err) ); exit(1); } } while (0);
1> ^
1>“template.cu”, line 99: error: identifier “exit” is undefined
1> do { do { cudaError err = cudaMemcpy( d_idata, h_idata, mem_size, cudaMemcpyHostToDevice); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 100, cudaGetErrorString( err) ); exit(1); } } while (0); cudaError err = cudaThreadSynchronize(); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 100, cudaGetErrorString( err) ); exit(1); } } while (0);
1> ^
1>“template.cu”, line 99: error: identifier “exit” is undefined
1> do { do { cudaError err = cudaMemcpy( d_idata, h_idata, mem_size, cudaMemcpyHostToDevice); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 100, cudaGetErrorString( err) ); exit(1); } } while (0); cudaError err = cudaThreadSynchronize(); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 100, cudaGetErrorString( err) ); exit(1); } } while (0);
1> ^
1>“template.cu”, line 103: error: identifier “exit” is undefined
1> do { do { cudaError err = cudaMalloc( (void**) &d_odata, mem_size); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 104, cudaGetErrorString( err) ); exit(1); } } while (0); cudaError err = cudaThreadSynchronize(); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 104, cudaGetErrorString( err) ); exit(1); } } while (0);
1> ^
1>“template.cu”, line 103: error: identifier “exit” is undefined
1> do { do { cudaError err = cudaMalloc( (void**) &d_odata, mem_size); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 104, cudaGetErrorString( err) ); exit(1); } } while (0); cudaError err = cudaThreadSynchronize(); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 104, cudaGetErrorString( err) ); exit(1); } } while (0);
1> ^
1>“template.cu”, line 113: error: identifier “exit” is undefined
1> do { cudaError_t err = cudaGetLastError(); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error: %s in file ‘%s’ in line %i : %s.\n”, “Kernel execution failed”, “template.cu”, 114, cudaGetErrorString( err) ); exit(1); } err = cudaThreadSynchronize(); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error: %s in file ‘%s’ in line %i : %s.\n”, “Kernel execution failed”, “template.cu”, 114, cudaGetErrorString( err) ); exit(1); } } while (0);
1> ^
1>“template.cu”, line 113: error: identifier “exit” is undefined
1> do { cudaError_t err = cudaGetLastError(); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error: %s in file ‘%s’ in line %i : %s.\n”, “Kernel execution failed”, “template.cu”, 114, cudaGetErrorString( err) ); exit(1); } err = cudaThreadSynchronize(); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error: %s in file ‘%s’ in line %i : %s.\n”, “Kernel execution failed”, “template.cu”, 114, cudaGetErrorString( err) ); exit(1); } } while (0);
1> ^
1>“template.cu”, line 118: error: identifier “exit” is undefined
1> do { do { cudaError err = cudaMemcpy( h_odata, d_odata, sizeof( float) * num_threads, cudaMemcpyDeviceToHost); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 120, cudaGetErrorString( err) ); exit(1); } } while (0); cudaError err = cudaThreadSynchronize(); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 120, cudaGetErrorString( err) ); exit(1); } } while (0);
1> ^
1>“template.cu”, line 118: error: identifier “exit” is undefined
1> do { do { cudaError err = cudaMemcpy( h_odata, d_odata, sizeof( float) * num_threads, cudaMemcpyDeviceToHost); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 120, cudaGetErrorString( err) ); exit(1); } } while (0); cudaError err = cudaThreadSynchronize(); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 120, cudaGetErrorString( err) ); exit(1); } } while (0);
1> ^
1>“template.cu”, line 120: error: identifier “exit” is undefined
1> if( CUTTrue != cutStopTimer( timer)) { fprintf((&__iob_func()[2]), “Cut error in file ‘%s’ in line %i.\n”, “template.cu”, 122); exit(1); };
1> ^
1>“template.cu”, line 122: error: identifier “exit” is undefined
1> if( CUTTrue != cutDeleteTimer( timer)) { fprintf((&__iob_func()[2]), “Cut error in file ‘%s’ in line %i.\n”, “template.cu”, 124); exit(1); };
1> ^
1>“template.cu”, line 132: error: identifier “exit” is undefined
1> if( CUTTrue != cutWriteFilef( “./data/regression.dat”, h_odata, num_threads, 0.0)) { fprintf((&__iob_func()[2]), “Cut error in file ‘%s’ in line %i.\n”, “template.cu”, 135); exit(1); };
1> ^
1>“template.cu”, line 149: error: identifier “exit” is undefined
1> do { do { cudaError err = cudaFree(d_idata); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 149, cudaGetErrorString( err) ); exit(1); } } while (0); cudaError err = cudaThreadSynchronize(); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 149, cudaGetErrorString( err) ); exit(1); } } while (0);
1> ^
1>“template.cu”, line 149: error: identifier “exit” is undefined
1> do { do { cudaError err = cudaFree(d_idata); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 149, cudaGetErrorString( err) ); exit(1); } } while (0); cudaError err = cudaThreadSynchronize(); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 149, cudaGetErrorString( err) ); exit(1); } } while (0);
1> ^
1>“template.cu”, line 150: error: identifier “exit” is undefined
1> do { do { cudaError err = cudaFree(d_odata); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 150, cudaGetErrorString( err) ); exit(1); } } while (0); cudaError err = cudaThreadSynchronize(); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 150, cudaGetErrorString( err) ); exit(1); } } while (0);
1> ^
1>“template.cu”, line 150: error: identifier “exit” is undefined
1> do { do { cudaError err = cudaFree(d_odata); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 150, cudaGetErrorString( err) ); exit(1); } } while (0); cudaError err = cudaThreadSynchronize(); if( cudaSuccess != err) { fprintf((&__iob_func()[2]), “Cuda error in file ‘%s’ in line %i : %s.\n”, “template.cu”, 150, cudaGetErrorString( err) ); exit(1); } } while (0);
1> ^
1>26 errors detected in the compilation of “D:\DOCUME~1\joaquin\LOCALS~1\Temp/tmpxft_0000044c_00000000-5.ii”.
1>Build log was saved at “file://d:\Program Files\NVIDIA Corporation\NVIDIA CUDA SDK\projects\template\Debug\BuildLog.htm”
1>template - 44 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

nevermind

the stdio.h file was corrupted on lib dir in visual…

grrrrr :angry: