'How to create 32-bit dll file for OpenCV version 4.0.1?

I have tried many methods to build a 32-bit version of OpenCV version 4.0.1, however to no avail. I have tried using CMake and the file I require is opencv_world401.dll

May I know if anyone has any steps for me to follow to build the 64 bit source code so that I can have a complete 32-bit package in return? It seems there will be missing files when I use CMake.

Thank you!

Tried using CMake to build the 64 bit source code into a 32 bit package

Currently OpenCV_world401.dll is giving me a winerror 193



Solution 1:[1]

I have the same problem. It would be resolved easily. Firt, you need to download your intended version, in this case, under OpenCV – 4.1.2 section choose Windows from https://opencv.org/releases/. Then, download the executable file, run it, and extract it wherever you want. Afterward you will be able to find, for example, opencv_world401.dll under "opencv\build\x64\" folder.

Solution 2:[2]

The opencv source code is platform in-dependent, which means you can build dll/so files for different platform with this same source code tree. But to get a Win32 build you'll have to make some change during "Configuration" step, because by default it will generate a x64 platform build.

Choose Win32 Platform

Basically that's the only change required.

If you can read Chinese, here's a detailed tutorial for you to reference: https://www.csdn.net/tags/OtDaQg0sODk1MS1ibG9n.html

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Payam Jome Yazdian
Solution 2