I have successfully built the "Release x64" version of AlexeyAB's C/C++ solution called darknet. I am using a PC with Windows 10 Professional, Visual Studio Community 2019, an NVIDIA GeForce RTX 2080 Ti GPU, CUDA 10.2, cuDNN 7.6.5, and OpenCV 4.1.2.
While I have successfully built the "Release x64" version of darknet, the Debug version fails to build due to three errors:
- MSB3721 associated with line 764 of CUDA 10.2.targets:
The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin\nvcc.exe" -gencode=arch=compute_30,code=\"sm_30,compute_30\" -gencode=arch=compute_75,code=\"sm_75,compute_75\" --use-local-env -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\HostX86\x64" -x cu -IC:\opencv_4.1.2\opencv\build\include -I..\..\include -I..\..\3rdparty\stb\include -I..\..\3rdparty\pthreads\include -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include" -I\include -I\include -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include" -G --keep-dir x64\Debug -maxrregcount=0 --machine 64 --compile -cudart static -g -DCUDNN_HALF -DCUDNN -D_CRTDBG_MAP_ALLOC -D_MBCS -D_TIMESPEC_DEFINED -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_CRT_RAND_S -DGPU -DWIN32 -DDEBUG -D_CONSOLE -D_LIB -D_MBCS -Xcompiler "/EHsc /W3 /nologo /Od /Fdx64\Debug\vc142.pdb /FS /Zi /RTC1 /MDd " -o x64\Debug\network_kernels.cu.obj "C:\Users\Tom\Documents\AI\darknet\darknet\src\network_kernels.cu"" exited with code 1.
- An error associated with lines 149 and 150 of common_functions.h:
more than one instance of overloaded function "_malloc_dbg" has "C" linkage.
- An error associated with lines 149 and 150 of common_functions.h:
expected a type specifier.
Does anyone have any suggestions for resolving these three errors? It could be that these three errors are related. Someone suggested modifying the -ccbin option to reference a different compiler. If this seems likely, would you please offer concrete steps for changing this option? Are there other things I can do?
_CRTDBG_MAP_ALLOC
fromProperties->C/C++/Preprocessor->Preprocessor Definitions
– MERN