Examples provided in Nvidia

I am really new to the GPU programming. I just set up my Nvidia driver and installed everything about cuda.

so you can assume that I installed every thing necessary.

I downloaded examples provided online, for example: nbody. I tried to compile it by typing make.

It doesn’t compile, it shows the following:error:

must #include before using typeid

so, i tried added the line #include to the files that don’t compile, then, i tried to compile it again, I get the following errors:

Why do I get these errors? Is it because i didn’t set up the environment correctly?

make[1]: Entering directory /home/abcdsophia/cudaexample/NVIDIA_CUDA_SDK/common' In file included from src/cutil.cpp:50: ./../common/inc/cmd_arg_reader.h: In member function ‘const T* CmdArgReader::getArgHelper(const std::string&)’: ./../common/inc/cmd_arg_reader.h:416: error: must #include <typeinfo> before using typeid ./../common/inc/cmd_arg_reader.h:432: error: must #include <typeinfo> before using typeid In file included from ./../common/inc/stopwatch.h:37, from src/cutil.cpp:52: ./../common/inc/stopwatch_base.h: At global scope: ./../common/inc/stopwatch_base.h:74: warning: type qualifiers ignored on function return type ./../common/inc/stopwatch_base.h:78: warning: type qualifiers ignored on function return type In file included from ./../common/inc/stopwatch_base.h:91, from ./../common/inc/stopwatch.h:37, from src/cutil.cpp:52: ./../common/inc/stopwatch_base.inl:85: warning: type qualifiers ignored on function return type ./../common/inc/stopwatch_base.inl:96: warning: type qualifiers ignored on function return type In file included from ./../common/inc/stopwatch.h:44, from src/cutil.cpp:52: ./../common/inc/stopwatch_linux.h:64: warning: type qualifiers ignored on function return type ./../common/inc/stopwatch_linux.h:68: warning: type qualifiers ignored on function return type ./../common/inc/stopwatch_linux.h:144: warning: type qualifiers ignored on function return type ./../common/inc/stopwatch_linux.h:161: warning: type qualifiers ignored on function return type In file included from src/cutil.cpp:52: ./../common/inc/stopwatch.h:53: warning: type qualifiers ignored on function return type In file included from src/cutil.cpp:53: ./../common/inc/bank_checker.h:52: warning: type qualifiers ignored on function return type ./../common/inc/bank_checker.h:238: warning: type qualifiers ignored on function return type src/cutil.cpp: In function ‘CUTBoolean<unnamed>::loadPPM(const char*, unsigned char**, unsigned int*, unsigned int*, unsigned int*)’: src/cutil.cpp:179: error: ‘strncmp’ was not declared in this scope src/cutil.cpp: In function ‘char* cutFindFilePath(const char*, const char*)’: src/cutil.cpp:572: error: ‘strlen’ was not declared in this scope src/cutil.cpp:577: error: ‘strcpy’ was not declared in this scope src/cutil.cpp:578: error: ‘strcat’ was not declared in this scope src/cutil.cpp:604: error: ‘strncpy’ was not declared in this scope src/cutil.cpp: In function ‘CUTBoolean cutGetCmdLineArgumentstr(int, const char**, const char*, char**)’: src/cutil.cpp:1165: error: ‘strcpy’ was not declared in this scope src/cutil.cpp: In function ‘CUTBoolean<unnamed>::cutReadFile(const char*, T**, unsigned int*, bool) [with T = float]’: src/cutil.cpp:640: instantiated from here src/cutil.cpp:492: error: ‘memcpy’ was not declared in this scope src/cutil.cpp: In function ‘CUTBoolean<unnamed>::cutReadFile(const char*, T**, unsigned int*, bool) [with T = double]’: src/cutil.cpp:654: instantiated from here src/cutil.cpp:492: error: ‘memcpy’ was not declared in this scope src/cutil.cpp: In function ‘CUTBoolean<unnamed>::cutReadFile(const char*, T**, unsigned int*, bool) [with T = int]’: src/cutil.cpp:668: instantiated from here src/cutil.cpp:492: error: ‘memcpy’ was not declared in this scope src/cutil.cpp: In function ‘CUTBoolean<unnamed>::cutReadFile(const char*, T**, unsigned int*, bool) [with T = unsigned int]’: src/cutil.cpp:682: instantiated from here src/cutil.cpp:492: error: ‘memcpy’ was not declared in this scope src/cutil.cpp: In function ‘CUTBoolean<unnamed>::cutReadFile(const char*, T**, unsigned int*, bool) [with T = char]’: src/cutil.cpp:697: instantiated from here src/cutil.cpp:492: error: ‘memcpy’ was not declared in this scope src/cutil.cpp: In function ‘CUTBoolean<unnamed>::cutReadFile(const char*, T**, unsigned int*, bool) [with T = unsigned char]’: src/cutil.cpp:711: instantiated from here src/cutil.cpp:492: error: ‘memcpy’ was not declared in this scope make[1]: *** [obj/release/cutil.cpp_o] Error 1 make[1]: Leaving directory /home/abcdsophia/cudaexample/NVIDIA_CUDA_SDK/common’
make: *** [lib/libcutil.so] Error 2

Are you using a supported Linux distribution?