我正在嘗試編譯某人發給我的cuda項目。雖然編譯階段通過,但鏈接階段失敗。下面是錯誤的一個示例:Cuda錯誤:函數已經在另一個.cu.obj文件中定義
Error 298 error LNK2005: "int __cdecl compare_ints(void const *,void const *)" ([email protected]@[email protected]) already defined in 3level_1.cu.obj decode_p4.cu.obj
基本上,文件decode_p4.cu.obj抱怨並功能compare_ints在3level_1.cu.obj已定義。有關如何避免此行爲的任何想法?
下面是類似的錯誤列表是否有幫助:
Error 384 error LNK2005: "int __cdecl compare_ints(void const *,void const *)" ([email protected]@[email protected]) already defined in 3level_1.cu.obj decode_p4.cu.obj god
Error 385 error LNK2005: "int __cdecl cpu_intersection(unsigned int *,int,unsigned int *,int)" ([email protected]@[email protected]) already defined in 3level_1.cu.obj decode_p4.cu.obj god
Error 386 error LNK2005: "int __cdecl intersection_cpu(unsigned int * * const,int * const,int)" ([email protected]@[email protected]) already defined in 3level_1.cu.obj decode_p4.cu.obj god
Error 387 error LNK2005: "void __cdecl sort_it(unsigned int * * const,int * const,int)" ([email protected]@[email protected]) already defined in 3level_1.cu.obj decode_p4.cu.obj god
Error 388 error LNK2005: "int __cdecl GPU_Intersection(unsigned int * * const,int * const,int,unsigned int *,unsigned int *,unsigned int *,struct uint4 *)" ([email protected]@[email protected]@@Z) already defined in 3level_1.cu.obj decode_p4.cu.obj god
Error 389 error LNK2005: "int __cdecl ceilPow2(int)" ([email protected]@[email protected]) already defined in 3level_1.cu.obj decode_p4.cu.obj god
Error 390 error LNK2005: "void __cdecl recAllocate1(int,int)" ([email protected]@[email protected]) already defined in 3level_1.cu.obj decode_p4.cu.obj god
Error 391 error LNK2005: "unsigned int __cdecl getceilPow2(unsigned int)" ([email protected]@[email protected]) already defined in 3level_1.cu.obj decode_p4.cu.obj god
Error 392 error LNK2005: "void __cdecl runTest(int,char * *)" ([email protected]@[email protected]) already defined in 3level_1.cu.obj decode_p4.cu.obj god
Error 393 error LNK2005: "void __cdecl __device_stub__Z13scanBlockMAX1P5uint4S0_Pj(struct uint4 *,struct uint4 *,unsigned int *)" ([email protected]@[email protected]@[email protected]) already defined in 3level_1.cu.obj decode_p4.cu.obj god
Error 394 error LNK2005: "void __cdecl scanBlockMAX1(struct uint4 *,struct uint4 *,unsigned int *)" ([email protected]@[email protected]@[email protected]) already defined in 3level_1.cu.obj decode_p4.cu.obj god
Error 395 error LNK2005: "void __cdecl __device_stub__Z16scanBlockMAX1_gpP5uint4S0_Pj(struct uint4 *,struct uint4 *,unsigned int *)" ([email protected]@[email protected]@[email protected]) already defined in 3level_1.cu.obj decode_p4.cu.obj god
人們,請幫我解決這個問題。我必須儘快做到這一點 – Programmer