을위한 CUDA 코드를 구축하는 동안 2010LNK2005 오류가 난 비주얼 스튜디오에 새로운 오전과 내가 비주얼 스튜디오를 사용하여 내 CUDA 코드에서 cuPrintf를 사용하는 것을 시도하고있다 cuPrintf
#include "cuPrintf.cu"
#include "cuPrintf.cuh"
그러나 나는 다음과 같은 오류
gpuLBMSolver.cu.obj : error LNK2005: "int __cdecl cuPrintf(char const *)" ([email protected]@[email protected]) already defined in cuPrintf.cu.obj
1>gpuLBMSolver.cu.obj : error LNK2005: "void __cdecl cuPrintfRestrict(int,int)" ([email protected]@[email protected]) already defined in cuPrintf.cu.obj
1>gpuLBMSolver.cu.obj : error LNK2005: _cudaPrintfInit already defined in cuPrintf.cu.obj
1>gpuLBMSolver.cu.obj : error LNK2005: _cudaPrintfEnd already defined in cuPrintf.cu.obj
1>gpuLBMSolver.cu.obj : error LNK2005: _cudaPrintfDisplay already defined in cuPrintf.cu.obj
무엇입니까 사전에 동일한 코드 내 리눅스 시스템에서 잘 작동했다
... 감사
내 코드에서 작동하지 않습니다 ... 여전히 동일한 오류가 발생합니다 ... – amitdonanand
내 대답이 업데이트되었습니다. 당신은 당신의 파일 중 하나에서'#include "cuPrintf.cu"'를하고 있고, *와 *는 당신의 프로젝트에서'cuPrintf.cu'를 따로 만들고 있습니다. 프로젝트에'cuPrintf.cu'를 빌드하지 마십시오. 그냥 포함 시키십시오. –
감사합니다. – amitdonanand