Can't build OpenCV Cygwin+Mingw64 [closed]
Hallo, I trying to compilate openCV frome source files, but I have a problems.
RD fdwDetails);
^~~~~~~~
/usr/include/w32api/msacm.h:336:3: error: 'MMRESULT' does not name a type
MMRESULT ACMAPI acmFormatEnumA(HACMDRIVER had,LPACMFORMATDETAILSA pafd,ACMFOR
MATENUMCBA fnCallback,DWORD_PTR dwInstance,DWORD fdwEnum);
^~~~~~~~
/usr/include/w32api/msacm.h:337:3: error: 'MMRESULT' does not name a type
MMRESULT ACMAPI acmFormatEnumW(HACMDRIVER had,LPACMFORMATDETAILSW pafd,ACMFOR
MATENUMCBW fnCallback,DWORD_PTR dwInstance,DWORD fdwEnum);
^~~~~~~~
/usr/include/w32api/msacm.h:356:3: error: 'MMRESULT' does not name a type
MMRESULT ACMAPI acmFormatSuggest
^~~~~~~~
/usr/include/w32api/msacm.h:401:5: error: 'LPWAVEFORMATEX' does not name a type
LPWAVEFORMATEX pwfx;
^~~~~~~~~~~~~~
/usr/include/w32api/msacm.h:409:5: error: 'LPWAVEFORMATEX' does not name a type
LPWAVEFORMATEX pwfxEnum;
^~~~~~~~~~~~~~
/usr/include/w32api/msacm.h:420:5: error: 'LPWAVEFORMATEX' does not name a type
LPWAVEFORMATEX pwfx;
^~~~~~~~~~~~~~
/usr/include/w32api/msacm.h:428:5: error: 'LPWAVEFORMATEX' does not name a type
LPWAVEFORMATEX pwfxEnum;
^~~~~~~~~~~~~~
/usr/include/w32api/msacm.h:451:3: error: 'MMRESULT' does not name a type
MMRESULT ACMAPI acmFormatChooseA(LPACMFORMATCHOOSEA pafmtc);
^~~~~~~~
/usr/include/w32api/msacm.h:452:3: error: 'MMRESULT' does not name a type
MMRESULT ACMAPI acmFormatChooseW(LPACMFORMATCHOOSEW pafmtc);
^~~~~~~~
/usr/include/w32api/msacm.h:490:3: error: 'MMRESULT' does not name a type
MMRESULT ACMAPI acmFilterTagDetailsA(HACMDRIVER had,LPACMFILTERTAGDETAILSA pa
ftd,DWORD fdwDetails);
^~~~~~~~
/usr/include/w32api/msacm.h:491:3: error: 'MMRESULT' does not name a type
MMRESULT ACMAPI acmFilterTagDetailsW(HACMDRIVER had,LPACMFILTERTAGDETAILSW pa
ftd,DWORD fdwDetails);
^~~~~~~~
/usr/include/w32api/msacm.h:506:3: error: 'MMRESULT' does not name a type
MMRESULT ACMAPI acmFilterTagEnumA(HACMDRIVER had,LPACMFILTERTAGDETAILSA paftd
,ACMFILTERTAGENUMCBA fnCallback,DWORD_PTR dwInstance,DWORD fdwEnum);
^~~~~~~~
/usr/include/w32api/msacm.h:507:3: error: 'MMRESULT' does not name a type
MMRESULT ACMAPI acmFilterTagEnumW(HACMDRIVER had,LPACMFILTERTAGDETAILSW paftd
,ACMFILTERTAGENUMCBW fnCallback,DWORD_PTR dwInstance,DWORD fdwEnum);
^~~~~~~~
/usr/include/w32api/msacm.h:547:3: error: 'MMRESULT' does not name a type
MMRESULT ACMAPI acmFilterDetailsA(HACMDRIVER had,LPACMFILTERDETAILSA pafd,DWO
RD fdwDetails);
^~~~~~~~
/usr/include/w32api/msacm.h:548:3: error: 'MMRESULT' does not name a type
MMRESULT ACMAPI acmFilterDetailsW(HACMDRIVER had,LPACMFILTERDETAILSW pafd,DWO
RD fdwDetails);
^~~~~~~~
/usr/include/w32api/msacm.h:562:3: error: 'MMRESULT' does not name a type
MMRESULT ACMAPI acmFilterEnumA(HACMDRIVER had,LPACMFILTERDETAILSA pafd,ACMFIL
TERENUMCBA fnCallback,DWORD_PTR dwInstance,DWORD fdwEnum);
^~~~~~~~
/usr/include/w32api/msacm.h:563:3: error: 'MMRESULT' does not name a type
MMRESULT ACMAPI acmFilterEnumW(HACMDRIVER had,LPACMFILTERDETAILSW pafd,ACMFIL
TERENUMCBW fnCallback,DWORD_PTR dwInstance,DWORD fdwEnum);
^~~~~~~~
/usr/include/w32api/msacm.h:643:3: error: 'MMRESULT' does not name a type
MMRESULT ACMAPI acmFilterChooseA(LPACMFILTERCHOOSEA pafltrc);
^~~~~~~~
/usr/include/w32api/msacm.h:644:3: error: 'MMRESULT' does not name a type
MMRESULT ACMAPI acmFilterChooseW(LPACMFILTERCHOOSEW pafltrc);
^~~~~~~~
/usr/include/w32api/msacm.h:676:3: error: 'MMRESULT' does not name a type
MMRESULT ACMAPI acmStreamOpen(LPHACMSTREAM phas,HACMDRIVER had,LPWAVEFORMATEX
pwfxSrc,LPWAVEFORMATEX pwfxDst,LPWAVEFILTER pwfltr,DWORD_PTR dwCallback,DWORD_P
TR dwInstance,DWORD fdwOpen);
^~~~~~~~
/usr/include/w32api/msacm.h:682:3: error: 'MMRESULT' does not name a type
MMRESULT ACMAPI acmStreamClose
^~~~~~~~
/usr/include/w32api/msacm.h:685:3: error: 'MMRESULT' does not name a type ...
there is somebuild version here for visual studio. Now never try with cygwin . Try to delete CMakeCache.txt and set all parameters WITH to OFF (uncheck everything)
[ 29%] Linking CXX shared library ../../bin/opencv_videoio330.dll /usr/lib/gcc/x86_64-pc-cygwin/6.3.0/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lavifil32.lib /usr/lib/gcc/x86_64-pc-cygwin/6.3.0/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lavicap32.lib /usr/lib/gcc/x86_64-pc-cygwin/6.3.0/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lwinmm.lib /usr/lib/gcc/x86_64-pc-cygwin/6.3.0/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lmsvfw32.lib collect2: error: ld returned 1 exit status make[2]: * [modules/videoio/CMakeFiles/opencv_videoio.dir/build.make:228: bin/ opencv_videoio330.dll] Error 1 make[1]: [CMakeFiles/Makefile2:2574: modules/videoio/CMakeFiles/opencv_video io.dir/all] Error 2 make: ** [Makefile:163: all] Error 2
msvfw32.lib WITH_VFW is off? try to disable module video (-DBUILD_opencv_video:BOOL=OFF and videoio -DBUILD_opencv_videoio:BOOL=OFF )
Have you got this link ?
Yes, WITH_VFW is off. Does I have turn off ENABLE_PRECOMPILED_HEADERS too? Now is turned off.
yes ENABLE_PRECOMPILED_HEADERS must be off
ok, it was off.
disable dnn module -DBUILD_opencv_dnn:BOOL=OFF
[ 72%] Building RC object modules/photo/CMakeFiles/opencv_photo.dir/vs_version.r c.obj /usr/lib/gcc/x86_64-pc-cygwin/6.3.0/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lcomctl32.lib /usr/lib/gcc/x86_64-pc-cygwin/6.3.0/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lgdi32.lib /usr/lib/gcc/x86_64-pc-cygwin/6.3.0/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lole32.lib /usr/lib/gcc/x86_64-pc-cygwin/6.3.0/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lsetupapi.lib /usr/lib/gcc/x86_64-pc-cygwin/6.3.0/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lws2_32.lib collect2: error: ld returned 1 exit status make[2]: * [modules/highgui/CMakeFiles/opencv_highgui.dir/build.make:147: bin/ opencv_highgui330.dll] Error 1 make[1]: * [CMakeFiles/Makefile2:1488: modules/highgui/CMakeFile
I don't understand lwinmm.lib setupapi.lib .lib is for VS not mingw shouldn't it be .a ?
cmake generator must be -G"Unix Makefiles"
ok, I turned off opencv_highgui330 and it is complete. Do you know, how to fix past problems and compile complete (full) OpenCV? Now I have calib, core, features, flann, imgcodecs, imgproc, ml, objected, photo, stitching dlls.