NVAPI .:. error LNK2019: unresolved external symbol NvAPI_GPU_GetThermalSettings referenced in

I’m trying to write a simple code for getting some information from my GPU (NVidia Geforce 760 GTX) such as temperature using NVAPI.
I started with CUDA sample codes. Maybe you see these sample codes provided by NVidia. I copied one of the sample codes (‘CUDA Samples\v6.5\0_Simple\vectorAdd’) to write in this sample. I copied all of ‘.h’ files of NVAPI to ‘CUDA Samples\v6.5\common\inc’ and copied ‘nvapi.lib’ to ‘CUDA Samples\v6.5\common\lib\Win32’ and copied ‘nvapi64.lib’ to ‘CUDA Samples\v6.5\common\lib\x64’.
I preformed these copies to ‘C:\Program Files\CUDA\v6.5\include’ and ‘C:\Program Files\CUDA\v6.5\lib’.

But when I build my code I received these errors:

Error 28 error LNK2019: unresolved external symbol NvAPI_GPU_GetThermalSettings referenced in function...
Error 29 error LNK2019: unresolved external symbol NvAPI_GPU_GetFullName referenced in function...
and some similar errors.
1 Like

The problem you are experiencing is a linker error. It’s not enough simply to copy files from one place to another. To link against a library (e.g. nvapi.ib or nvapi64.lib) it’s necessary to add that library to the linker specification in the Visual Studio project.

By the way, this question (and the 4 other thread entries you made at the same time in the CUDA Programming and Performance area) has nothing to do with CUDA. And it has nothing to do with .h files.

1 Like

As I stated, I copied these nvapi*.h and nvapi*.lib files to include and lib folders of cuda sample codes. All of the cuda sample codes was being build in those folders correctly. I copied one of the sample codes (vecAdd) and added my new codes (including temperature management codes) to that project.

My main question is that why this task does not work? I didn’t create any new project. I used from prepared project files that worked correctly and I copied include and lib files.

Besides, after reading your comment, I added address of extracted folders of nvapi to Linker -> General -> Additional Library Dependencies. This is shown in picture below.

Please also take a look at the picture below: I wrote just three lines of my desired code (inside vecAdd code), and build it. There is no error, although I used two datatypes from nvapi library. But when I add some other codes, I will be faced with the mentioned error.

Please help me

The question is answered here: http://stackoverflow.com/questions/27472116/error-lnk2019-unresolved-external-symbol-nvapi-gpu-getthermalsettings-reference