“.\x64\Debug\cudaOpenMP.cu.obj”
]
Creating command line “link.exe @“d:\CUDA\Exercises\test_mp\NVIDIA CUDA SDK\projects\cudaOpenMP\x64\Debug\RSP00001040366052.rsp” /NOLOGO /ERRORREPORT:PROMPT”
Output Window Linking…
cudaOpenMP.cu.obj : error LNK2019: unresolved external symbol cudaThreadExit referenced in function main
cudaOpenMP.cu.obj : error LNK2019: unresolved external symbol cudaGetLastError referenced in function main
cudaOpenMP.cu.obj : error LNK2019: unresolved external symbol cudaFree referenced in function main
cudaOpenMP.cu.obj : error LNK2019: unresolved external symbol cudaConfigureCall referenced in function main
cudaOpenMP.cu.obj : error LNK2019: unresolved external symbol cudaMemcpy referenced in function main
cudaOpenMP.cu.obj : error LNK2019: unresolved external symbol cudaMemset referenced in function main
cudaOpenMP.cu.obj : error LNK2019: unresolved external symbol cudaMalloc referenced in function main
cudaOpenMP.cu.obj : error LNK2019: unresolved external symbol cudaGetDevice referenced in function main
cudaOpenMP.cu.obj : error LNK2019: unresolved external symbol cudaGetErrorString referenced in function main
cudaOpenMP.cu.obj : error LNK2019: unresolved external symbol cudaSetDevice referenced in function main
cudaOpenMP.cu.obj : error LNK2019: unresolved external symbol cudaGetDeviceProperties referenced in function main
cudaOpenMP.cu.obj : error LNK2019: unresolved external symbol cudaGetDeviceCount referenced in function main
cudaOpenMP.cu.obj : error LNK2019: unresolved external symbol cudaSetupArgument referenced in function __device_stub__Z17kernelAddConstantPii
cudaOpenMP.cu.obj : error LNK2019: unresolved external symbol __cudaRegisterFunction referenced in function __sti____cudaRegisterAll_45_tmpxft_00001714_00000000_6_cudaO
penMP_cpp1_ii_940c3a36
cudaOpenMP.cu.obj : error LNK2019: unresolved external symbol __cudaRegisterFatBinary referenced in function __sti____cudaRegisterAll_45_tmpxft_00001714_00000000_6_cudaO
penMP_cpp1_ii_940c3a36
cudaOpenMP.cu.obj : error LNK2019: unresolved external symbol __cudaUnregisterFatBinary referenced in function __cudaUnregisterBinaryUtil
cudaOpenMP.cu.obj : error LNK2019: unresolved external symbol cudaLaunch referenced in function “enum cudaError __cdecl cudaLaunch(char *)” (??$cudaLaunch@D@@YA?AW4cudaError@@PEAD@Z)
…/…/bin/win64/Debug/cudaOpenMP.exe : fatal error LNK1120: 17 unresolved externals
Results Build Time 0:00
Build log was saved at “file://d:\CUDA\Exercises\test_mp\NVIDIA CUDA SDK\projects\cudaOpenMP\x64\Debug\BuildLog.htm”
cudaOpenMP - 18 error(s), 0 warning(s)
Hi. I am running with the same problem. It is almost impossible to get all necessary settings correct within Visual Studio. I got this problem whan I replaced a version of cuda.rules with version 2.3 Cuda.Rules and tried to rebuild necessary dependencies for CUDA-project. It is most probably a missing path or other setup alike somewhere. If you success to fing the correct place and parameter, please let us know!
I wonder what kind of dimmed-vision nerds there are in NVIDIA cuda labs as they are not able to publish a straight forward cookbook how to set up the VS environment in each revision of CUDA. I have been strugling endlessly with incorrect setups found from this same forum, weird indications like “invalid device function” etc. which all turned out to be a consequence of improper parameters and build rules. Finding the reason was just pure luck on fourth week of frustrating testing. No good. Conclusion: if you start using CUDA with Visual Studio, you will need several weeks to learn all necessary tricks and setups with the environment, not related to coding CUDA at all. Considering other solutions is really sensible. External Image
I’m also having a similar problem. To be honest I think you’re being a bit harsh on CUDA though, if it were an MS product it’d probably be really east to use with VS. I’m having to use VS because of where I work and getting it to work is a pain. Usually I work under Linux and I can tell you that everything CUDA just works, right out the box…
OK, I finally solved this. It was very simple in the end…
My app was not linking to cudart.lib, the CUDA runtime library. I added cudart.lib to my additional libraries in my “start-up” project, which is not my CUDA project, and now it works.
Simple really. Why doesn’t the build rule do this automatically. It’s such a minor thing yet it causes a lot of problems as far as I can tell. This thread is just one of many I’ve come accross on the subject. Now it’s one of the first to have a solution :)
I try to add “cudart.lib” to the project, and I found other libs like “cudartemu.lib cutil32D.lib shrUtils32D.lib” is already included. Then the problem still happen. I think the problem is derived from “shrUtils32D.lib”, but I don’t know how to solve. :"> please take some suggestions, thank you very much.
To Jason and all others having compiler issues with Visual Studio:
As a newb, I experienced these issues too. I found a wizard that sets up stuff correctly for using CUDA in Visual Studio.
What do you mean by “start up” project. How is it different from your normal project? I really need help with this. Can you let me know where the startup project is located in VS and how to configure it.
This thread is a year old but I had this same issue, and its real frustrating finding a thread unfinished, so I will finish it. I found that by putting cudart.lib in the additional dependencies solved the problem. Additional dependencies can be found: project properties >> Linker >> input.
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.
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. External Media
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. External Media