Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When I use win_build_opencv.cmd,I encountered some problems #1126

Open
RealCommonCat opened this issue Nov 3, 2023 · 4 comments
Open

When I use win_build_opencv.cmd,I encountered some problems #1126

RealCommonCat opened this issue Nov 3, 2023 · 4 comments

Comments

@RealCommonCat
Copy link

When the script "mingw32-make install" "Building CXX object" it showed some trobles

Description

C:\opencv\build>mingw32-make install
[ 0%] Built target opencv_dnn_plugins
[ 0%] Built target opencv_highgui_plugins
[ 0%] Built target gen-pkgconfig
[ 1%] Built target jsimd
[ 2%] Built target libopenjp2
[ 2%] Built target opencv_videoio_plugins
[ 3%] Built target zlib
[ 8%] Built target opencv_core
[ 12%] Built target opencv_imgproc
[ 14%] Built target libjpeg-turbo
[ 16%] Built target libtiff
[ 22%] Built target libwebp
[ 27%] Built target IlmImf
[ 28%] Built target libpng
[ 29%] Built target opencv_imgcodecs
[ 29%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_obsensor/obsensor_uvc_stream_channel.cpp.obj
In file included from C:\opencv\opencv-4.8.1\modules\videoio\src\cap_obsensor\obsensor_stream_channel_msmf.hpp:41,
from C:\opencv\opencv-4.8.1\modules\videoio\src\cap_obsensor\obsensor_uvc_stream_channel.cpp:33:
C:\opencv\opencv-4.8.1\modules\videoio\src\cap_obsensor\obsensor_stream_channel_msmf.hpp: In instantiation of 'class cv::obsensor::ComPtr':
C:\opencv\opencv-4.8.1\modules\videoio\src\cap_obsensor\obsensor_stream_channel_msmf.hpp:145:42: required from here
C:\opencv\opencv-4.8.1\modules\videoio\src\cap_obsensor\obsensor_stream_channel_msmf.hpp:106:27: error: could not convert template argument 'cv::obsensor::ComPtr::__T_IID_getter' from 'const IID& (cv::obsensor::ComPtr::)()' {aka 'const GUID& (cv::obsensor::ComPtr::)()'} to 'const IID& ()()' {aka 'const GUID& ()()'}
106 | _COM_SMARTPTR_TYPEDEF(T, __uuidof(T));

Your Environment

  • Operating System and version: Win10
  • OpenCV version used: nil
  • How did you install OpenCV? no
  • GoCV version used: 0.35.0
  • Go version: 1.12.1
  • Did you run the env.sh or env.cmd script before trying to go run or go build? yes
@stedwick
Copy link

I also cannot get it installed on Windows 11. It cannot find the header files, even though they are right there?

PS C:\Users\phili\SourceCode\goopencv> set CGO_CPPFLAGS="-IC:/Users/phili/SourceCode/opencv/build/include"
PS C:\Users\phili\SourceCode\goopencv> go run -tags customenv "C:\Users\phili\go\pkg\mod\gocv.io\x\gocv@v0.35.0\cmd\version\main.go"
# gocv.io/x/gocv
In file included from aruco.cpp:1:0:
aruco.h:5:10: fatal error: opencv2/opencv.hpp: No such file or directory
 #include <opencv2/opencv.hpp>
          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.

PS C:\Users\phili\SourceCode\goopencv> dir C:\Users\phili\SourceCode\opencv\build\include\opencv2\opencv.hpp

    Directory: C:\Users\phili\SourceCode\opencv\build\include\opencv2

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----         9/27/2023   9:54 AM           3558 opencv.hpp

PS C:\Users\phili\SourceCode\goopencv>

@stedwick
Copy link

I tried installing it in MSYS2 and got a different error:

phili@PhilBook3 UCRT64 ~/gocv
$ go run "C:\msys64\ucrt64\lib\go\pkg\mod\gocv.io\x\gocv@v0.35.0\cmd\version\main.go"

# gocv.io/x/gocv
C:\Users\phili\go\pkg\mod\gocv.io\x\gocv@v0.35.0\calib3d_string.go:3:9: undefined: CalibFlag
C:\Users\phili\go\pkg\mod\gocv.io\x\gocv@v0.35.0\calib3d_string.go:29:9: undefined: CalibCBFlag
C:\Users\phili\go\pkg\mod\gocv.io\x\gocv@v0.35.0\core_string.go:3:9: undefined: MatType
...
C:\Users\phili\go\pkg\mod\gocv.io\x\gocv@v0.35.0\core_string.go:159:9: too many errors

@ajmandourah
Copy link

ajmandourah commented Nov 27, 2023

I also cannot get it installed on Windows 11. It cannot find the header files, even though they are right there?

PS C:\Users\phili\SourceCode\goopencv> set CGO_CPPFLAGS="-IC:/Users/phili/SourceCode/opencv/build/include"

maybe use "\" instead of "/"

@x41lex
Copy link

x41lex commented Nov 27, 2023

Building with "-DWITH_OBSENSOR=OFF" as suggested here fixed this issue for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants