Skip to content

fix msys2 with apothecary packaged opencv4 - #8566

Open
danoli3 wants to merge 3 commits into
openframeworks:masterfrom
danoli3:msys2-bundled-opencv
Open

danoli3 wants to merge 3 commits into
openframeworks:masterfrom
danoli3:msys2-bundled-opencv

Conversation

@danoli3

@danoli3 danoli3 commented Sep 29, 2026

Copy link
Copy Markdown
Member

Link the Apothecary-built OpenCV 4 static libraries on msys2 instead of the pacman opencv package.

  • addons/ofxOpenCv/addon_config.mk: msys2 section lists the bundled archives under libs/opencv/lib/msys2/% (arch wildcard) plus -lzlib, no longer uses pkg-config or excludes the bundled tree
  • scripts/msys2/install_dependencies.sh: stop installing any pacman opencv (pinned 4.x or 5.x fallback) and stop rewriting addon_config.mk

Requires an Apothecary msys2 opencv4 package whose libopencv_world.a defines the core data tables.

The msys2 CI job mixed a pinned system OpenCV 4.13 (via pkg-config)
with the Apothecary-bundled libopencv_world.a, whose objects reference
cv::g_Saturate8u / cv::g_8x32fTab as DLL imports with no DLL present,
failing the allAddonsExample link with undefined symbols.

Use exactly one OpenCV on msys2: the Apothecary-built OpenCV 4 static
libraries bundled under addons/ofxOpenCv/libs/opencv, mirroring how the
Android and Emscripten sections already work.

- addons/ofxOpenCv/addon_config.mk: msys2 section lists the bundled
  static archives explicitly instead of pkg-config opencv4, and no
  longer excludes the bundled headers/libs
- scripts/msys2/install_dependencies.sh: remove the pinned pacman
  OpenCV install, the 5.x fallback, and the addon_config.mk
  pkg-config rewrite

Requires an Apothecary msys2 opencv4 package whose libopencv_world.a
actually defines the core data tables (the 2026-09-28 package's world
archive only carries .refptr imports for them and cannot link).
The Apothecary package lays its static archives out per architecture
(lib/msys2/x86_64, lib/msys2/aarch64, ...). % is expanded to a glob by
the makefile addon parser (and understood by the Project Generator),
so match whichever arch directory the installed package ships instead
of hardcoding x86_64.
MSYS2's zlib package ships libz.a / libz.dll.a, not libzlib, so
-lzlib failed the allAddonsExample link with "cannot find -lzlib".
libzlib.a only exists in the emscripten bundle.
@danoli3
danoli3 force-pushed the msys2-bundled-opencv branch from b1a6314 to d01d439 Compare September 30, 2026 14:49
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

Successfully merging this pull request may close these issues.

1 participant