From the book “Professional CUDA C Programming” I tried to compile the first example by command line.
I got the following error message:
E:\Cuda\Uli\CodeSamples\chapter01>nvcc -arch sm_60 hello.cu -o hello
e:\cuda\uli\codesamples\chapter01…/common/common.h(69): error: incomplete type is not allowed
e:\cuda\uli\codesamples\chapter01…/common/common.h(70): error: incomplete type is not allowed
e:\cuda\uli\codesamples\chapter01…/common/common.h(71): error: identifier “gettimeofday” is undefined
3 errors detected in the compilation of “C:/Users/nickl/AppData/Local/Temp/tmpxft_00005470_00000000-12_hello.cpp1.ii”.
I tried to figure out what the problem is and this code includes ‘common.h’ from this book. I think this file is found, but in this file the lines 69 to 71 cause the Problem:
inline double seconds()
struct timeval tp;
struct timezone tzp;
int i = gettimeofday(&tp, &tzp);
return ((double)tp.tv_sec + (double)tp.tv_usec * 1.e-6);
#endif // _COMMON_H
The inline function seconds() is’n used, but the compiler seems to have a problem with struct timeval tp and struct timezone. What do I have to do to compile all the Files properely?