What build do the official Opencv builds use?

Hi, I’m trying to use OpenCV with rust using the opencv-rust crate. Problem is I want to use the aruco lib so I have to manually build OpenCV with contrib. I keep running into linker errors and believe it’s because I’m not building all the needed files.

I got it to work using the prebuilt library files, so I’m wondering what build target is used to create those files?

For context, I’m using Windows.

correct. show your attempt, please

that’s some kind of “manual”, hand generated wrapper.
do you have a link for us ?
are you even sure, it covers the aruco module ?
looking here, see " Contrib modules", it does not look like it’s in ;(

it does not look like an opencv version problem at all, more like a deficiancy in the rust wrappers.

That’s an older version of the OpenCV crate. The later versions have support. I don’t know too much about the binding generation process, but the bindings are generated automatically based on the built binaries. The crate automatically detects what modules are included and creates bindings for them.

I’ve tried a bunch of different ways of building OpenCV with cmake. I used the gui to configure it. Setting the OPENCV_EXTRAS_MODULE_PATH=C:/tools/opencv_contrib-4.5.3/modules and reconfiguring. I also set BUILD_opencv_world=ON. For the sake of compile time, I turned off Tests, Python, JS, and Java build cmake flags. In this case, I assume those would not mess up the files I need built.

Once I generate the VS 2017 project, I wasn’t sure what target to build. I’ve tried ALL_BUILD, INSTALL, ZERO_CHECK, opencv_world.
The linker error I get after building INSTALL with these settings is:

right, ok

that looks like a bad idea, as it seems to expect “single module” libs (but idk)

btw, did you build static or dyamic opencv libs ?

libopencv-8579c76e595dcd51.rlib(img_hash.o) : error LNK2019: unresolved external symbol "public: void __cdecl cv::img_hash::ImgHashBase::compute(class cv::_InputArray const &,class cv::_OutputArray const &)" 

i guess, you get a ton more errors like this for the other opencv libs ?

img_hash.o – this looks totally wrong. it should link against a .lib file
. msvc also has .obj files, while .o is gcc

misconfigured toolchain ?

I seem to get the same error despite what libraries I’m using with the rust crate.

That img_hash.o looks to be from the rust build, not the opencv build.

Looks like were correct, turning off BUILD_opencv_world generated the individual modules that do seem to work when build target INSTALL. I don’t know why opencv_world wouldn’t work since the opencv_world from Releases - OpenCV seems to work fine with opencv-rust examples. Do you know the build parameters/environment for that build? I would like to just link 1 file rather than list the individual modules.