Open blakeliu opened 6 years ago
I encounter the same problem if compiling static lib:
@blakeliu @yuanxy92 Hi,
I can't reproduce your errors. I can compile Release or Debug & x64. And Dynamic or Static library. MSVS 2015, OpenCV 3.2.0 on Windows 7 x64.
Also yolo_cpp_dll.sln
by default compiled without OpenCV, so I don't know why there are occurs errors depends on OpenCV.
Try to do:
open \yolo_cpp_dll.sln
-> (right click on project) -> properties -> C/C++ -> Preprocessor -> Undefine Preprocessor Definitions, and add here OPENCV
@AlexeyAB opencv3.3.0, not opencv3.2.0
@blakeliu Right now I downloaded OpenCV 3.3.0: https://sourceforge.net/projects/opencvlibrary/files/opencv-win/3.3.0/opencv-3.3.0-vc14.exe/download
And I successfully compiled yolo_cpp_dll.sln
: Release or Debug & x64. Dynamic or Static library. MSVS 2015, OpenCV 3.3.0 on Windows 7 x64.
Hi @blakeliu
I faced the same issue before . I created system variable for OPENCV_BUILD directory
So in the MSVS config steps, like below,
(right click on project) -> properties -> C/C++ -> General -> Additional Include Directories
i used PATHs like: $(OPENCV_BUILD)\opencv\build\include etc. this was causing the issue.
When I changed to the full path, e.g. C:\opencv_2.4.13\opencv\build\include, I don't see this issue anymore.
win10, opencv3.3.0, vs2015 build yolo_cpp_dl debug version still failed
Check the configuration properties as well as the version of opencv, which the author defines using version 3.0.0 instead of 3.3.0.
Dears, it seems this problem only happens in debug mode, for release mode it is of no problem. I got the same error, still not solved it with opencv3.3.0 (with IDE visual studio 2015) yet. I found that delete the OPENCV definition from the project properties --> c/c++ --> preprocess --> preporcess definitions (remove the "OPENCV" here), the project will be OK (in debug mode). thus it seems the problem is from opencv versions, need further checking to understand...
while I changed to Opencv3.2.0, Opencv3.0.0, both compiled successfully, for the debug mode. the link for opencv3.2.0 is https://nchc.dl.sourceforge.net/project/opencvlibrary/opencv-win/3.2.0/opencv-3.2.0-vc14.exe
Another issue (not related to the above one) is that you need to
in the Darknet.c, since in debug mode the author uses _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); to trace the memory leak! Otherwise it will report an error C2065: “_CRTDBG_ALLOC_MEM_DF”: not defined.
1>d:\dependency\opencv3.3.0\include\opencv2\core\cvdef.h(58): error C2061: 语法错误: 标识符“cv” 1>d:\dependency\opencv3.3.0\include\opencv2\core\cvdef.h(434): fatal error C1070: 文件“d:\dependency\opencv3.3.0\include\opencv2\core\cvdef.h”中的 #if/#endif 对不匹配
but, vs2015 build yolo_cpp_dll release version success!.