Running NPP sample problem linking error

hi, I am new to cuda.

I was trying to run the "boxFilter" from the NPP samples but not succeeded.

I'm using window 7 64bit… I was able to compile and run the samples from the cuda CPU computing SDK 3.2

so I downloaded everything that say 64 bit at version 3.2.

and changed the linker to the correct one.

Still … I receive some error.



here are the errors that I am receiving…



---------------------------------------------------



Compiling…

cl : Command line warning D9035 : option 'Wp64' has been deprecated and will be removed in a future release

boxFilter.cpp

Linking…

boxFilter.obj : error LNK2019: unresolved external symbol _nppiFilterBox_8u_C1R referenced in function _main

boxFilter.obj : error LNK2019: unresolved external symbol _cudaMemcpy2D@28 referenced in function "public: static void __cdecl npp::ImageAllocator::DeviceToHostCopy2D(unsigned char *,unsigned int,unsigned char const *,unsigned int,unsigned int,unsigned int)" (?DeviceToHostCopy2D@?$ImageAllocator@E$00@npp@@SAXPAEIPBEIII@Z)

utilnpp-mt-gd.lib(ImageIO.obj) : error LNK2001: unresolved external symbol _cudaMemcpy2D@28

boxFilter.obj : error LNK2019: unresolved external symbol _nppiFree referenced in function "public: static void __cdecl npp::ImageAllocator::Free2D(unsigned char *)" (?Free2D@?$ImageAllocator@E$00@npp@@SAXPAE@Z)

utilnpp-mt-gd.lib(ImageIO.obj) : error LNK2001: unresolved external symbol _nppiFree

boxFilter.obj : error LNK2019: unresolved external symbol _nppiMalloc_8u_C1 referenced in function "public: static unsigned char * __cdecl npp::ImageAllocator::Malloc2D(unsigned int,unsigned int,unsigned int *,bool)" (?Malloc2D@?$ImageAllocator@E$00@npp@@SAPAEIIPAI_N@Z)

utilnpp-mt-gd.lib(ImageIO.obj) : error LNK2001: unresolved external symbol _nppiMalloc_8u_C1

boxFilter.obj : error LNK2019: unresolved external symbol _cudaMalloc@8 referenced in function "enum cudaError __cdecl cudaMalloc(unsigned char * *,unsigned int)" (??$cudaMalloc@E@@YA?AW4cudaError@@PAPAEI@Z)

utilnpp-mt-gd.lib(ImageIO.obj) : error LNK2001: unresolved external symbol _cudaMalloc@8

utilnpp-mt-gd.lib(ImageIO.obj) : error LNK2019: unresolved external symbol __imp__FreeImage_GetBits@4 referenced in function "void __cdecl npp::loadImage(class std::basic_string,class std::allocator > const &,class npp::ImageCPU > &)" (?loadImage@npp@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAV?$ImageCPU@E$00V?$ImageAllocatorCPU@E$00@npp@@@1@@Z)

utilnpp-mt-gd.lib(ImageIO.obj) : error LNK2019: unresolved external symbol __imp__FreeImage_GetPitch@4 referenced in function "void __cdecl npp::loadImage(class std::basic_string,class std::allocator > const &,class npp::ImageCPU > &)" (?loadImage@npp@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAV?$ImageCPU@E$00V?$ImageAllocatorCPU@E$00@npp@@@1@@Z)

utilnpp-mt-gd.lib(ImageIO.obj) : error LNK2019: unresolved external symbol __imp__FreeImage_GetWidth@4 referenced in function "void __cdecl npp::loadImage(class std::basic_string,class std::allocator > const &,class npp::ImageCPU > &)" (?loadImage@npp@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAV?$ImageCPU@E$00V?$ImageAllocatorCPU@E$00@npp@@@1@@Z)

utilnpp-mt-gd.lib(ImageIO.obj) : error LNK2019: unresolved external symbol __imp__FreeImage_GetHeight@4 referenced in function "void __cdecl npp::loadImage(class std::basic_string,class std::allocator > const &,class npp::ImageCPU > &)" (?loadImage@npp@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAV?$ImageCPU@E$00V?$ImageAllocatorCPU@E$00@npp@@@1@@Z)

utilnpp-mt-gd.lib(ImageIO.obj) : error LNK2019: unresolved external symbol __imp__FreeImage_GetBPP@4 referenced in function "void __cdecl npp::loadImage(class std::basic_string,class std::allocator > const &,class npp::ImageCPU > &)" (?loadImage@npp@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAV?$ImageCPU@E$00V?$ImageAllocatorCPU@E$00@npp@@@1@@Z)

utilnpp-mt-gd.lib(ImageIO.obj) : error LNK2019: unresolved external symbol __imp__FreeImage_GetColorType@4 referenced in function "void __cdecl npp::loadImage(class std::basic_string,class std::allocator > const &,class npp::ImageCPU > &)" (?loadImage@npp@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAV?$ImageCPU@E$00V?$ImageAllocatorCPU@E$00@npp@@@1@@Z)

utilnpp-mt-gd.lib(ImageIO.obj) : error LNK2019: unresolved external symbol __imp__FreeImage_Load@12 referenced in function "void __cdecl npp::loadImage(class std::basic_string,class std::allocator > const &,class npp::ImageCPU > &)" (?loadImage@npp@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAV?$ImageCPU@E$00V?$ImageAllocatorCPU@E$00@npp@@@1@@Z)

utilnpp-mt-gd.lib(ImageIO.obj) : error LNK2019: unresolved external symbol __imp__FreeImage_FIFSupportsReading@4 referenced in function "void __cdecl npp::loadImage(class std::basic_string,class std::allocator > const &,class npp::ImageCPU > &)" (?loadImage@npp@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAV?$ImageCPU@E$00V?$ImageAllocatorCPU@E$00@npp@@@1@@Z)

utilnpp-mt-gd.lib(ImageIO.obj) : error LNK2019: unresolved external symbol __imp__FreeImage_GetFIFFromFilename@4 referenced in function "void __cdecl npp::loadImage(class std::basic_string,class std::allocator > const &,class npp::ImageCPU > &)" (?loadImage@npp@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAV?$ImageCPU@E$00V?$ImageAllocatorCPU@E$00@npp@@@1@@Z)

utilnpp-mt-gd.lib(ImageIO.obj) : error LNK2019: unresolved external symbol __imp__FreeImage_GetFileType@8 referenced in function "void __cdecl npp::loadImage(class std::basic_string,class std::allocator > const &,class npp::ImageCPU > &)" (?loadImage@npp@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAV?$ImageCPU@E$00V?$ImageAllocatorCPU@E$00@npp@@@1@@Z)

utilnpp-mt-gd.lib(ImageIO.obj) : error LNK2019: unresolved external symbol __imp__FreeImage_SetOutputMessage@4 referenced in function "void __cdecl npp::loadImage(class std::basic_string,class std::allocator > const &,class npp::ImageCPU > &)" (?loadImage@npp@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAV?$ImageCPU@E$00V?$ImageAllocatorCPU@E$00@npp@@@1@@Z)

utilnpp-mt-gd.lib(ImageIO.obj) : error LNK2019: unresolved external symbol __imp__FreeImage_Save@16 referenced in function "void __cdecl npp::saveImage(class std::basic_string,class std::allocator > const &,class npp::ImageCPU > const &)" (?saveImage@npp@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV?$ImageCPU@E$00V?$ImageAllocatorCPU@E$00@npp@@@1@@Z)

utilnpp-mt-gd.lib(ImageIO.obj) : error LNK2019: unresolved external symbol __imp__FreeImage_Allocate@24 referenced in function "void __cdecl npp::saveImage(class std::basic_string,class std::allocator > const &,class npp::ImageCPU > const &)" (?saveImage@npp@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV?$ImageCPU@E$00V?$ImageAllocatorCPU@E$00@npp@@@1@@Z)

c:\Users\Kei\Desktop\SDK\samples\boxFilter\…\…\bin\Win32\boxFilter-mt-gd.exe : fatal error LNK1120: 18 unresolved externals

Hello,

I’ve got the same problem here and couldn’t manage to fix it…

I’m using visual studio 2010 on windows 7 64bits.

Thanks in advance.

I also faced this similar problem (saying this: unresolved external symbol _cudaMemcpy2D@28 referenced in function "public: static void __cdecl), I think this problem is related to VS setup (I was using Windows-7, 64 bit, VS-2008, NVIDIA-GPU GTX 285), I was lost and could not make the system working, and Finally, I started to work on Linux environment, thats very good and user friendly to work with GPU.

Ok, thanks for the advice. Does anybody solved this problem ? (I can’t afford to migrate to a linux system…)

NPP does not work on windows??? Thats strange…
I hope some one from NV looks into this…

I also have the same problem with NPP not working in windows. My setup is,

Windows 7 x64
Visual Studio 2008 Pro
Cuda 3.2.16 Release
GTX 460 (SLI)
Device Driver 263.06
NPP 3.2.16 (32 bit version since I’m only compiling for x86, not sure if this matters…)

I open the solution is VS2008, change the Linker->General-> Additional Library Directories, to point to the,
…\SDK\common\FreeImage\lib
…\SDK\common\npp\lib
…\SDK\common\lib

and also changed the C/C++ -> General, to point to,
…\SDK\common\UtiNPP
…\SDK\common\npp\include
…\SDK\common\FreeImage\include

I then get the following errors in VS…

1>boxFilter.obj : error LNK2019: unresolved external symbol _cudaMemcpy2D@28 referenced in function “public: static void __cdecl npp::ImageAllocator<unsigned char,1>::DeviceToHostCopy2D(unsigned char *,unsigned int,unsigned char const *,unsigned int,unsigned int,unsigned int)” (?DeviceToHostCopy2D@?$ImageAllocator@E$00@npp@@SAXPAEIPBEIII@Z)
1>utilnpp-mt-gd.lib(ImageIO.obj) : error LNK2001: unresolved external symbol _cudaMemcpy2D@28
1>boxFilter.obj : error LNK2019: unresolved external symbol _cudaMalloc@8 referenced in function “enum cudaError __cdecl cudaMalloc(unsigned char * *,unsigned int)” (??$cudaMalloc@E@@YA?AW4cudaError@@PAPAEI@Z)
1>utilnpp-mt-gd.lib(ImageIO.obj) : error LNK2001: unresolved external symbol _cudaMalloc@8
1>c:\Users\hau\Desktop\npp_3.2.16_win_32\SDK\samples\boxFilter…\bin\Win32\boxFilter-mt-gd.exe : fatal error LNK1120: 2 unresolved externals

If anyone knows of a solution or see’s what I’m doing wrong help would be appreciated.

I’m also hoping that with Cuda Release 4.0 coming soon the NPP library will also be updated and bugs worked out.

Sorry but it seems I have the same problem with the brand new RC … :wallbash:

Hello, some news here :

I’ve tried to open samples (from the 4.0 RC) with Visual C++ express 2008 and it works perfectly…

I guess the VS2010’s linker proceeds another way that is slightly different than VS2008’s…

That’s great news for me! I’m going to download and try it out. Did you have to uninstall your previous Cuda Version and Driver? Also if you don’t mind my asking, what exactly is your SDK version and procedure you followed to getting the 4.0RC working. Thanks!

I don’t know if I had to uninstall the previous version but I did to avoid problems.

I’m using these tools :

    [*]dev driver 270.32[*]cuda toolkit ver. 4.0.11[*]gpu computing sdk 4.0.11

These are all part of the new CUDA 4.0 RC kit.

I just installed everything in the order of the list above.

I just can’t modify any file even if it compiles.

When I’m interested in using a sample I copy/paste it somewhere else in order to be free to edit the files. (don’t forget to check the linker’s configuration)

Thanks! I also read in the Getting Started Guide for Cuda that,

“CUDA Toolkit versions 3.1 and earlier installed into C:\CUDA by default, requiring prior CUDA Toolkit versions to be uninstalled before the installation of new versions. Beginning with CUDA Toolkit 3.2, multiple CUDA Toolkit versions can be installed simultaneously.”

I plan to install 4.0.11 without uninstalling 3.2 and will confirm whether this is true.