hybridgroup / gocv

Go package for computer vision using OpenCV 4 and beyond. Includes support for DNN, CUDA, OpenCV Contrib, and OpenVINO.
https://gocv.io
Other
6.73k stars 868 forks source link

Compile build error, Win10 system #1248

Open mingtianquan opened 3 weeks ago

mingtianquan commented 3 weeks ago

GOROOT=C:\Program Files\Go GOPATH=D:\go Paht=C:\Program Files\mingw-w64\x86_64-8.1.0-release-posix-seh-rt_v6-rev0\mingw64\bin Paht=C:\Program Files\CMake\bin


Source code directory D:\go\src\gocv.io\x\gocv


C:\Users\hai>go version go version go1.21.0 windows/amd64


C:\Users\hai>gcc --version gcc (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0 Copyright (C) 2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Win_fuild_opencv.cmd in the source code directory Only modified C: \ Program Files \ CMake \ bin set PATH=%PATH%; C:\Program Files\CMake\bin; C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin Run cmd in directory Compile error, the error message is as follows


  |        ^

C:/opencv/opencv-4.10.0/modules/core/include\opencv2/core/cvdef.h:428:34: note: expanded from macro 'CV_EXPORTS' 428 | # define CV_EXPORTS declspec(dllexport) | ^ In file included from C:\opencv\build\modules\imgproc\opencl_kernels_imgproc.cpp:3: In file included from C:/opencv/opencv-4.10.0/modules/core/include\opencv2/core.hpp:56: C:/opencv/opencv-4.10.0/modules/core/include\opencv2/core/matx.hpp:72:44: warning: definition of implicit copy assignment operator for 'Matx_TOp' is deprecated because it has a user-provided copy constructor [-Wdeprecated-copy-with-user-provided-copy] 72 | struct CV_EXPORTS Matx_TOp { Matx_TOp() {} Matx_TOp(const Matx_TOp&) {} }; | ^ C:/opencv/opencv-4.10.0/modules/core/include\opencv2/core/matx.hpp:72:19: note: in implicit copy assignment operator for 'cv::Matx_TOp' first required here 72 | struct CV_EXPORTS Matx_TOp { Matx_TOp() {} Matx_TOp(const Matx_TOp&) {} }; | ^ C:/opencv/opencv-4.10.0/modules/core/include\opencv2/core/matx.hpp:72:8: note: due to 'Matx_TOp' being dllexported 72 | struct CV_EXPORTS Matx_TOp { Matx_TOp() {} Matx_TOp(const Matx_TOp&) {} }; | ^ C:/opencv/opencv-4.10.0/modules/core/include\opencv2/core/cvdef.h:428:34: note: expanded from macro 'CV_EXPORTS' 428 | # define CV_EXPORTS declspec(dllexport) | ^ 7 warnings generated. [ 17%] Building RC object modules/imgproc/CMakeFiles/opencv_imgproc.dir/vs_version.rc.res [ 17%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/opencv_imgproc_main.cpp.obj [ 17%] Linking CXX shared library ....\bin\opencv_imgproc4100.dll lld-link: warning: ignoring unknown argument '--gc-sections' [ 17%] Built target opencv_imgproc [ 17%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/alpha_processing_sse41.c.obj C:\opencv\opencv-4.10.0\3rdparty\libwebp\src\dsp\alpha_processing_sse41.c:52:26: error: always_inline function '_mm_shuffle_epi8' requires target feature 'ssse3', but would be inlined into function 'ExtractAlpha_SSE41' that is compiled without support for 'ssse3' 52 | const m128i b0 = _mm_shuffle_epi8(a0, kCstAlpha0); | ^ C:\opencv\opencv-4.10.0\3rdparty\libwebp\src\dsp\alpha_processing_sse41.c:53:26: error: always_inline function '_mm_shuffle_epi8' requires target feature 'ssse3', but would be inlined into function 'ExtractAlpha_SSE41' that is compiled without support for 'ssse3' 53 | const m128i b1 = _mm_shuffle_epi8(a1, kCstAlpha1); | ^ C:\opencv\opencv-4.10.0\3rdparty\libwebp\src\dsp\alpha_processing_sse41.c:54:26: error: always_inline function '_mm_shuffle_epi8' requires target feature 'ssse3', but would be inlined into function 'ExtractAlpha_SSE41' that is compiled without support for 'ssse3' 54 | const m128i b2 = _mm_shuffle_epi8(a2, kCstAlpha2); | ^ C:\opencv\opencv-4.10.0\3rdparty\libwebp\src\dsp\alpha_processing_sse41.c:55:26: error: always_inline function '_mm_shuffle_epi8' requires target feature 'ssse3', but would be inlined into function 'ExtractAlpha_SSE41' that is compiled without support for 'ssse3' 55 | const m128i b3 = _mm_shuffle_epi8(a3, kCstAlpha3); | ^ 4 errors generated. mingw32-make[2]: [3rdparty\libwebp\CMakeFiles\libwebp.dir\build.make:424: 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/dsp/alpha_processing_sse41.c.obj] Error 1 mingw32-make[1]: [CMakeFiles\Makefile2:4622: 3rdparty/libwebp/CMakeFiles/libwebp.dir/all] Error 2 mingw32-make: *** [Makefile:165: all] Error 2

C:\opencv\build>rmdir c:\opencv\opencv-4.10.0 /s /q

C:\opencv\build>rmdir c:\opencv\opencv_contrib-4.10.0 /s /q

C:\opencv\build>chdir /D D:\go\src\gocv.io\x\gocv

D:\go\src\gocv.io\x\gocv>