Package Details: mingw-w64-opencv 4.1.1-1

Git Clone URL: (read-only)
Package Base: mingw-w64-opencv
Description: Open Source Computer Vision Library (mingw-w64)
Upstream URL:
Licenses: BSD
Submitter: xantares
Maintainer: drakkan
Last Packager: drakkan
Votes: 2
Popularity: 0.004044
First Submitted: 2015-09-14 18:31
Last Updated: 2019-07-28 09:17

Latest Comments

1 2 3 Next › Last »

drakkan commented on 2019-07-28 09:21

@FoPref, I just retested pkgconfig shared and static build with 4.1.1 (some changes were needed to my build script) and cmake shared build. For cmake static build can you please test this patch?

From 0220c010c220654f18db2143bc2825940786af87 Mon Sep 17 00:00:00 2001
From: Nicola Murino <>
Date: Sat, 27 Jul 2019 20:05:10 +0200
Subject: [PATCH] OpenCVModule.cmake: add RUNTIME_OUTPUT_NAME and

 cmake/OpenCVModule.cmake | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/cmake/OpenCVModule.cmake b/cmake/OpenCVModule.cmake
index 799592b..7fba7ba 100644
--- a/cmake/OpenCVModule.cmake
+++ b/cmake/OpenCVModule.cmake
@@ -956,7 +956,9 @@ macro(_ocv_create_module)

   set_target_properties(${the_module} PROPERTIES
-    OUTPUT_NAME "${the_module}${OPENCV_DLLVERSION}"
+    OUTPUT_NAME "${the_module}"
+    ARCHIVE_OUTPUT_NAME "${the_module}"

this way the static libs will not have version suffix. The patch breaks pkg-build based static build, anyway I can try to find a common fix if it works for cmake, thanks

drakkan commented on 2019-07-17 10:15


in my test project static build using pkg-config works fine.

Do you modified the lapack pc file as suggested below?

Can you please share a simple test project to use as reproducer? Maybe my test project for static building does not cover all cases :) thanks!

FoPref commented on 2019-07-17 09:38

I know the latest package version is just a version dump, however it looks like with 4.0.1 everything builds fine, whereas with 4.1.0 cblas is missing from the static libs.

drakkan commented on 2019-02-08 14:17

@FoPref, thanks for reporting.

I use pkg-config and so I fixed static build for pkg-config case as you can see inside the PKGBUILD (line 83). This really seems an upstream issue: both pc files and cmake files are broken in some way for shared and static build (please see fixes inside PKGBUILD).

I'll try to fix static cmake build as soon as I have some spare time

FoPref commented on 2019-02-08 14:10

Another problem with the file seems to be that it does not provide the right library names for static builds. The lib names provided in ${OpenCV_LIBRARIES} are, e.g., opencv_core, or opencv_imgproc. The correct names would have the version number appended (opencv_imgproc401 etc).

Note that at the same time, pkg-config does provide the correct names, e.g. -lopencv_imgproc401, and a static build is successful.

FoPref commented on 2019-02-06 17:11

The OpenCVConfig.cmake included in this package is broken. Using CMake with OpenCV dependency fails. The reason is that the INSTALL_PATH is wrongly determined.


--- old/OpenCVConfig.cmake     2019-02-06 18:09:22.293211050 +0100
+++ new/OpenCVConfig.cmake     2019-02-06 18:09:32.579844658 +0100
@@ -77,7 +77,7 @@
 # Extract the directory where *this* file has been installed (determined at cmake run-time)
 # Get the absolute path with no ../.. relative marks, to eliminate implicit linker warnings
-get_filename_component(OpenCV_INSTALL_PATH "${OpenCV_CONFIG_PATH}/../../../../../" REALPATH)
+get_filename_component(OpenCV_INSTALL_PATH "${OpenCV_CONFIG_PATH}/../../../" REALPATH)

 # Search packages for host system instead of packages for target system.
 # in case of cross compilation this macro should be defined by toolchain file

drakkan commented on 2018-05-05 16:58

@billypilgrim, in the last update I fixed lapack depends, please note that for static linking you need to add

Libs.private: -lgfortran -lquadmath

to the lapack pc file until lapack package is fixed,

@xantares since you are the mingw-w64-lapack maintainer please fix it

drakkan commented on 2018-05-04 14:35

I build in a clean chroot, probably you have several packages installed that are added as dependency automatically, for example in my case

x86_64-w64-mingw32-pkg-config --libs --static opencv

-L/usr/x86_64-w64-mingw32/lib -lopencv_stitching341 -lopencv_superres341 -lopencv_videostab341 -lopencv_aruco341 -lopencv_bgsegm341 -lopencv_bioinspired341 -lopencv_ccalib341 -lopencv_dnn_objdetect341 -lopencv_dpm341 -lopencv_face341 -lopencv_photo341 -lopencv_fuzzy341 -lopencv_hfs341 -lopencv_img_hash341 -lopencv_line_descriptor341 -lopencv_optflow341 -lopencv_reg341 -lopencv_rgbd341 -lopencv_saliency341 -lopencv_stereo341 -lopencv_structured_light341 -lopencv_phase_unwrapping341 -lopencv_surface_matching341 -lopencv_tracking341 -lopencv_datasets341 -lopencv_text341 -lopencv_dnn341 -lopencv_plot341 -lopencv_xfeatures2d341 -lopencv_shape341 -lopencv_video341 -lopencv_ml341 -lopencv_ximgproc341 -lopencv_calib3d341 -lopencv_features2d341 -lopencv_highgui341 -lopencv_videoio341 -lopencv_flann341 -lopencv_xobjdetect341 -lopencv_imgcodecs341 -lopencv_objdetect341 -lopencv_xphoto341 -lopencv_imgproc341 -lopencv_core341 -lgdi32 -lcomdlg32 -ljpeg -ltiff -llzma -ljpeg -lz -lpng16 -lz -lwebp -lm

as you can see I have no protobuf,lapack,cblas ecc.. and my Libs.private line is empty I added the needed libraries inside the PKGBUILD here:

I suggest to build in a clean chroot as for arch linux guidelines

as wrote in the wiki you are getting unwanted linking on packages missing in the depends array

billypilgrim commented on 2018-05-04 14:12

I was also just adding compiler flags with pkg-config basically as you were.

This is what I get when running the same commands as you:

x86_64-w64-mingw32-pkg-config --libs --static opencv | grep protobuf

-L/usr/x86_64-w64-mingw32/lib -L/usr/x86_64-w64-mingw32/share/OpenCV/3rdparty/lib -L/usr/x86_64-w64-mingw32/lib -lopencv_stitching341 -lopencv_superres341 -lopencv_videostab341 -lopencv_aruco341 -lopencv_bgsegm341 -lopencv_bioinspired341 -lopencv_ccalib341 -lopencv_dnn_objdetect341 -lopencv_dpm341 -lopencv_face341 -lopencv_photo341 -lopencv_fuzzy341 -lopencv_hfs341 -lopencv_img_hash341 -lopencv_line_descriptor341 -lopencv_optflow341 -lopencv_reg341 -lopencv_rgbd341 -lopencv_saliency341 -lopencv_stereo341 -lopencv_structured_light341 -lopencv_phase_unwrapping341 -lopencv_surface_matching341 -lopencv_tracking341 -lopencv_datasets341 -lopencv_text341 -lopencv_dnn341 -lopencv_plot341 -lopencv_xfeatures2d341 -lopencv_shape341 -lopencv_video341 -lopencv_ml341 -lopencv_ximgproc341 -lopencv_calib3d341 -lopencv_features2d341 -lopencv_highgui341 -lopencv_videoio341 -lopencv_flann341 -lopencv_xobjdetect341 -lopencv_imgcodecs341 -lopencv_objdetect341 -lopencv_xphoto341 -lopencv_imgproc341 -lopencv_core341 -llibprotobuf -llapack.dll -lblas.dll -lcblas.dll -lcomctl32 -lgdi32 -lole32 -lsetupapi -lws2_32 -ljpeg.dll -lwebp.dll -lpng.dll -lz.dll -ltiff.dll -lavifil32 -lavicap32 -lwinmm -lmsvfw32 -lgdi32 -lcomdlg32 -ljpeg -ltiff -llzma -ljpeg -lz -lpng16 -lz -lwebp -lm

cat /usr/x86_64-w64-mingw32/lib/pkgconfig/opencv.pc | grep protobuf

Libs.private: -L${exec_prefix}/share/OpenCV/3rdparty/lib -llibprotobuf -L/usr/x86_64-w64-mingw32/lib -llapack.dll -lblas.dll -lcblas.dll -lcomctl32 -lgdi32 -lole32 -lsetupapi -lws2_32 -ljpeg.dll -lwebp.dll -lpng.dll -lz.dll -ltiff.dll -lavifil32 -lavicap32 -lwinmm -lmsvfw32 -lgdi32 -lcomdlg32

It's rather strange that we get different outputs.

drakkan commented on 2018-05-04 13:28

@billypilgrim, please explain how you get protobuf depends ecc..

in my qt+opencv app I simply added these lines in the pro file:

CONFIG += static

LIBS+=`x86_64-w64-mingw32-pkg-config --libs --static opencv`

and I was able to statically link my app.

Additionally on my system

cat /usr/x86_64-w64-mingw32/lib/pkgconfig/opencv.pc | grep protobuf


cat /usr/x86_64-w64-mingw32/lib/pkgconfig/opencv.pc | grep dll

show nothing,

protobuf was downloaded and builded by opencv but I think it should not be a dependency, I would like to fix the package even more if you provide the info, thanks! You can also write to me directly by email if you prefer, my email address is inside the PKGBUILD