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.75k stars 869 forks source link

opencv4.8.1 has been compiled and installed, but an error occurred when running gocv #1137

Closed zzy444626905 closed 11 months ago

zzy444626905 commented 11 months ago

opencv4.8.1 has been compiled and installed, but an error occurred when running gocv

Description

GOROOT=D:\download\go\go #gosetup
GOPATH=D:\download\go\go\gopath #gosetup
D:\download\go\go\bin\go.exe build -o C:\Users\zyzhang60\go\src\server-manager\PushStream\PushStream.exe . #gosetup
# server-manager/PushStream
D:\download\go\go\pkg\tool\windows_amd64\link.exe: running g++ failed: exit status 1
C:\Users\zyzhang60\AppData\Local\Temp\go-link-366771185\000020.o:aruco.cpp:(.text+0x22): undefined reference to `cv::aruco::getPredefinedDictionary(cv::aruco::PredefinedDictionaryType)'
C:\Users\zyzhang60\AppData\Local\Temp\go-link-366771185\000020.o:aruco.cpp:(.text+0x5b): undefined reference to `cv::aruco::RefineParameters::RefineParameters(float, float, bool)'
C:\Users\zyzhang60\AppData\Local\Temp\go-link-366771185\000020.o:aruco.cpp:(.text+0x80): undefined reference to `cv::aruco::ArucoDetector::ArucoDetector(cv::aruco::Dictionary const&, cv::aruco::DetectorParameters const&, cv::aruco::RefineParameters const&)'
C:\Users\zyzhang60\AppData\Local\Temp\go-link-366771185\000020.o:aruco.cpp:(.text+0xfd): undefined reference to `cv::aruco::RefineParameters::RefineParameters(float, float, bool)'
C:\Users\zyzhang60\AppData\Local\Temp\go-link-366771185\000020.o:aruco.cpp:(.text+0x124): undefined reference to `cv::aruco::ArucoDetector::ArucoDetector(cv::aruco::Dictionary const&, cv::aruco::DetectorParameters const&, cv::aruco::RefineParameters const&)'
C:\Users\zyzhang60\AppData\Local\Temp\go-link-366771185\000020.o:aruco.cpp:(.text+0x221): undefined reference to `cv::aruco::ArucoDetector::detectMarkers(cv::_InputArray const&, cv::_OutputArray const&, cv::_OutputArray const&, cv::_OutputArray const&) const'
...

Compilation finished with exit code 1

Steps to Reproduce

1. 2. 3. 4.

Your Environment

windows10
go version go1.20.3 windows/amd64
opencv4.8.1
gocv.io/x/gocv v0.35.0
zzy444626905 commented 11 months ago

i got it, opencv4.8.1 has not been compiled and installed rightly

zzy444626905 commented 11 months ago

i got it, opencv4.8.1 has not been compiled and installed rightly

workyu commented 8 months ago

May I ask how it was resolved? I encountered the same problem