so, this makes all the difference ?
if it leads to a wrong configuration, it probably should get reported
it is set to OFF by default (why did you change it ?)
it is irrelevant (or , should be !) for the python bindings in general
(if it’s ON, c++ libs will be merged to a single, fat one)
you correctly set BUILD_SHARED_LIBS=OFF, so it should link to the c++ libs statically, no matter if it’s 15 small or a single big one
The reason why I generate BUILD_opencv_world is in forums I observed that it is a commonly used method to enable BUILD_opencv_world.
When BUILD_opencv_world is enabled you do not need to look for which .dll should be included for different opencv functions.
Even if it is irrelevant, I think enabling BUILD_opencv_world prevents python3 bindings from being successfully built.
When I search for this error I observe others facing the same problem.
I can share the links if you want?
adding -DBUILD_opencv_world=ON and filling in the parameters as specified and it built OpenCV world and installed the python bindings to the site-packages directory.
I can then import cv2 without any errors. I even deleted the cv2 directory and installed a second time and everything still worked so I’m not sure what your issue is, maybe its because you don’t specify PYTHON3_PACKAGES_PATH. If you need futher assistance use the CMake command line and post the exact arguments you are using including the ouput from the configuration stage.
Using the command line, I tried to build opencv from source as you suggested.
I observe that config-3.10.py is being generated.
However, the number of the folders in cv2 folder is 4.
When I built with “BUILD_opencv_world OFF” the number of folders in the cv2 folder was 61.
Should DPYTHON3_PACKAGES_PATH point the folder in my environment or can I select any folder?
Another thing to note is that there is no DBUILD_opencv_python3 property in CMAKE GUI.
In the command line, if I remove -DBUILD_opencv_python3=ON config-3.10.py is not generated.
For the builts with BUILD_SHARED_LIBS OFF, I get linker errors.
When I add all .lib files to Additional Dependencies in Visual Studio Linker configurations the number of linker errors I get decreases. However, the number of linker errors does not become 0.
For the builts with BUILD_SHARED_LIBS OFF, should I add more configuration parameters for cmake?
I don’t have any issues on Windows 11 building the latest commit of OpenCV from the 4.x branch with those commands, maybe the CMake config output and the first linker errors you encounter will shed some light on the issue.
So eventhough I use .lib files do I still need some opencv .dll?
If so maybe my error is related to not changing the environment variables.
This would be nice because it means no error in the built process.
However, when I observe the bin folder under install there are a couple of .exe files but there is only one .dll which is opencv_videoio_ffmpeg480_64.dll
For Python bindings, the following configuration is fine
The configuration is also fine for C++ release.
However, for C++ debug I get the error indicating that python310_d.lib is not accessible.
That is because conda environments does not include python debug libraries.
I used pure Python installer(not conda) and selected to generate debug libraries.
Somehow the same file is not found by the installer.
Since I use conda as development environment I decided to go for 2 opencv from source builts.
One for python and one for C++(both debug and release).
Having 2 saperate builts does not hurt in my opinion.