Comments (16)
Hello @kruffin when you built OpenCV itself, perhaps you did not pickup all of the needed settings for OpenCV. This line is what sets all of the build settings on AppVeyor (Windows build), which is worth looking at as a base to compare to:
https://github.com/hybridgroup/gocv/blob/master/appveyor_build_opencv.cmd#L13
from gocv.
I had the same issue. The set of libraries in CGO_LDFLAGS differs from the set of libraries which are defined in the same environment variable for Linux. I just adjusted this set of libraries to be consistent and it started working...
from gocv.
Hi @ogrian thanks for the comment. Which things did you change? Perhaps we need to update the docs?
from gocv.
@deadprogram I have the code on my laptop at home. After the working day I'll describe the changes that I made.
from gocv.
I see the OSX and Linux versions set CGO_CXXFLAGS and they don't have the "331" suffix on the library names. I'll try these two after work, but looking forward to hear what @ogrian did to get it to work. I'll also take a look at the AppVeyor build @deadprogram and see if I need to fix something there. I did double check that the libraries listed are actually built and available in the directory.
export CGO_CXXFLAGS="--std=c++1z"
-lopencv_face331 ==> -lopencv_face
from gocv.
This config worked for me on Windows:
CGO_LDFLAGS
-L{PATH_TO_LIB_DIR} -lopencv_core331 -lopencv_face331 -lopencv_videoio331 -lopencv_videoio331 -lopencv_imgproc331 -lopencv_highgui331 -lopencv_imgcodecs331 -lopencv_objdetect331 -lopencv_features2d331 -lopencv_video331 -lopencv_xfeatures2d331
I'm not sure that all the needed libs are added here but this set of libraries allows to run all the examples, at least.
from gocv.
@kruffin the Windows build of OpenCV adds the suffix 331
to all of the lib files, so that is needed on Windows. The -L
flag needs to point to the destination that was used for for building the OpenCV libs into.
The other thing is to ensure that you have used all the same build flags as in the AppVeyor build. Some of them seen unimportant but are required.
from gocv.
I found that I had msys64 executables on my path so removed those thinking maybe that was the problem. Re-ran the build using the exact cmake command from the apveyor script (which was way easier and less error prone than using the cmake UI) and have the same error.
cmake C:\opencv\opencv-3.3.1 -G "MinGW Makefiles" -BC:\opencv\build -DENABLE_CXX11=ON -DOPENCV_EXTRA_MODULES_PATH=C:\opencv\opencv_contrib-3.3.1\modules -DBUILD_SHARED_LIBS=ON -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_opencv_java=OFF -DBUILD_opencv_python=OFF -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DBUILD_DOCS=OFF -DENABLE_PRECOMPILED_HEADERS=OFF -DBUILD_opencv_saliency=OFF -Wno-dev
I saw somewhere you can generate debug opencv libraries; I may try that next to see if I can get more output that a weird error code.
Could the issue be that I'm using the mingw32-make on a 64 bit system (with a mingw-w64 gcc)?
from gocv.
Hi @kruffin you should be using only the MinGW-W64 tools, including the compiler and linker, which is known as mingw32-make
. None of the other toolchains are known to work, at least from my own experimenting.
from gocv.
Well, I've definitely broken something now. The opencv_version.exe created when building opencv doesn't work anymore. It complains with
The procedure entry point GIBBERISH could not be located in the dynamic link library C:\opencv\build\install\x64\mingw\bin\libopencv_core331.dll.
Where GIBBERISH is auto generated characters.The only thing I did was rebuild after removing msys64 from my path.
C:\msys64\usr\bin
C:\msys64\mingw64\bin
from gocv.
set CGO_CPPFLAGS=-IC:\opencv\build\install\include
set CGO_LDFLAGS=-LC:\opencv\build\install\x64\mingw\lib -lopencv_core -lopencv_face -lopencv_videoio -lopencv_videoio -lopencv_imgproc -lopencv_highgui -lopencv_imgcodecs -lopencv_objdetect -lopencv_features2d -lopencv_video -lopencv_xfeatures2d
worked my windows10 & msys2.
from gocv.
I've added a Windows cmd
file to the dev
branch with the intention of simplifying the env configuration process in similar fashion as what the env.sh
file does for MacOS/Linux:
https://github.com/hybridgroup/gocv/blob/dev/env.cmd
from gocv.
The env.cmd script was released as part of v0.8.0 so now closing. Please reopen if needed. Thank you.
from gocv.
For anyone in the future I was getting this on windows 10 and I needed to restart my computer
from gocv.
import (
"github.com/andlabs/ui"
_ "github.com/andlabs/ui/winmanifest"
)
from gocv.
C:\opencv\build\install\x64\mingw\bin\libstdc++-6.dll 拷贝到C:\Windows\System32
from gocv.
Related Issues (20)
- Missing of some flags for calibration
- cannot range over contours (variable of type gocv.PointsVector) HOT 1
- This issue occurred when I was cross compiling HOT 3
- opencv4.8.1 has been compiled and installed, but an error occurred when running gocv HOT 3
- How to parse blob?
- Memory leak in ORB detector
- triangulatePoints
- Error installing OpenCV libtbb2 and libdc1394-22-dev not found HOT 1
- Issue using gocv 0.35.0 in combination with opencv 4.8.1 in docker HOT 1
- Update to Support Additional Fonts from HersheyFont HOT 1
- MinMaxIdx function does not return the correct index. HOT 2
- BoxPoints, MinAreaRect inconsistent with C++ version of OpenCV, causing precision issues HOT 2
- Why is Mat used for in Range instead of a scalar wit hsv? And how can I sat Mat to a lower HSV range? HOT 2
- Consider adding VideoWriterFileWithAPI?
- Compilation yields "/bin/sh: line 0: cd: OLDPWD not set" on MacOS HOT 2
- Severe Memory Leak During Conversion between Image and gocv.Mat HOT 1
- go run . doesn't work on macos sonoma 14.2.1 (23C71) HOT 3
- Missing ArUco when installing OpenCV Debian Repository HOT 2
- building a static binary with ` gocv/opencv:4.9.0-static` fails HOT 1
- Not able to run simple example HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gocv.