程序中出现这个问题:
error LNK2019: unresolved external symbol ___cudaRegisterLinkedBinary_49_tmpxft_000013c0_00000000_8_GPUCorrelation_cpp1_ii_94404af8 referenced in function “void __cdecl __sti____cudaRegisterAll_49_tmpxft_000013c0_00000000_8_GPUCorrelation_cpp1_ii_94404af8(void)” (?__sti____cudaRegisterAll_49_tmpxft_000013c0_00000000_8_GPUCorrelation_cpp1_ii_94404af8@@YAXXZ)
一直解决不了。。
这里有个类似的帖子:(不让发链接,我只好直接粘贴过来。。不好意思。。我只是想提供更多的信息而已)Hello,
I am working on Visual Studio 2008, using CUDA 5.0.
I am getting the following errors during linking:
Linking…
1>gqdtest_kernel.cu.obj : error LNK2019: unresolved external symbol ___cudaRegisterLinkedBinary_49_tmpxft_00001ed4_00000000_8_gqdtest_kernel_cpp1_ii_9571646c referenced in function “void __cdecl __sti____cudaRegisterAll_49_tmpxft_00001ed4_00000000_8_gqdtest_kernel_cpp1_ii_9571646c(void)” (?__sti____cudaRegisterAll_49_tmpxft_00001ed4_00000000_8_gqdtest_kernel_cpp1_ii_9571646c@@YAXXZ)
1>gqd_win.lib(common.cu.obj) : error LNK2019: unresolved external symbol ___cudaRegisterLinkedBinary_41_tmpxft_00001f38_00000000_8_common_cpp1_ii_4f760f83 referenced in function “void __cdecl __sti____cudaRegisterAll_41_tmpxft_00001f38_00000000_8_common_cpp1_ii_4f760f83(void)” (?__sti____cudaRegisterAll_41_tmpxft_00001f38_00000000_8_common_cpp1_ii_4f760f83@@YAXXZ)
1>gqd_win.lib(cuda_header.cu.obj) : error LNK2019: unresolved external symbol ___cudaRegisterLinkedBinary_46_tmpxft_00000e8c_00000000_8_cuda_header_cpp1_ii_e3ac5253 referenced in function “void __cdecl __sti____cudaRegisterAll_46_tmpxft_00000e8c_00000000_8_cuda_header_cpp1_ii_e3ac5253(void)” (?__sti____cudaRegisterAll_46_tmpxft_00000e8c_00000000_8_cuda_header_cpp1_ii_e3ac5253@@YAXXZ)
I have found ___cudaRegisterLinkedBinary in crt/host_runtime.h such as
crt/host_runtime.h:#define __REGISTERFUNCNAME_CORE(X) __cudaRegisterLinkedBinary##X
crt/host_runtime.h:#define ____cudaRegisterLinkedBinary(X) \
Could anyone help me to solve these errors?
Thank you
这个是第二个类似的帖子,其中说的第一个方法试了一下不得行,第二个方法不懂。。
I’m looking at simpleSeparateCompilation_vs2008.sln, which is part of the CUDA 5.0 samples package. The solution built successfully on the first try. I then made a slight modification (added whitespace) to simplieSeparateCompliation.cu and attempted to build the solution again. This resulted in a build error:
1>simpleSeparateCompilation.cu.obj : error LNK2019: unresolved external symbol ___cudaRegisterLinkedBinary_72_tmpxft_00001348_00000000_14_simpleSeparateCompilation_compute_35_cpp1_ii_e3db9f73 referenced in function “void __cdecl __sti____cudaRegisterAll_72_tmpxft_00001348_00000000_14_simpleSeparateCompilation_compute_35_cpp1_ii_e3db9f73(void)” (?__sti____cudaRegisterAll_72_tmpxft_00001348_00000000_14_simpleSeparateCompilation_compute_35_cpp1_ii_e3db9f73@@YAXXZ)
I’ve discovered two ways of getting around the error:
- Do a clean build / rebuild
- Delete simpleSeparateCompilation.device-link.obj prior to doing a build
Has anyone else encountered this problem? Any tips for avoiding the error?
Thanks.
万能的斑竹。。帮帮我吧。。谢谢