zbar icon indicating copy to clipboard operation
zbar copied to clipboard

Can this application be compiled on Windows 7?

Open GamerHammer2K4F647Ultimate opened this issue 3 years ago • 12 comments

Since I am running Windows 7, and there's no pre-built binaries for zbar-23.92 or above(I am tryna to decode a qr-code with binary data inside), I tried compiling, only to see that it can only be compiled on Linux.

Can it be compiled on Windows 7 without WSL?

Well, here are the steps.

  1. download and install VS 2019 from Microsoft Visual Studio site
  2. install cmake
  3. install git, then clone vcpkg source code and install libiconv, libpng and zlib on D disk
d:
cd /
git clone https://github.com/microsoft/vcpkg.git
cd d:/vcpkg
bootstrap-vcpkg.bat

vcpkg integrate install

vcpkg install libjpeg-turbo libjpeg-turbo:x64-windows
vcpkg install libpng libpng:x64-windows
vcpkg install libiconv libiconv:x64-windows
vcpkg install zlib zlib:x64-windows
  1. clone zbar source code
d:
cd /
git clone https://github.com/mchehab/zbar.git
  1. download zbar-cmake-msvc.zip and extract all files and folders to the zbar root folder (d:/zbar).
  2. use cmake generate the build environment.
d:
mkdir d:/zbar/build
cd d:/zbar/build
cmake .. -DCMAKE_TOOLCHAIN_FILE=D:/vcpkg/scripts/buildsystems/vcpkg.cmake
  1. open Visual Studio 2019 Developer Command Prompt, then build zbar with it.
d:
cd d:/zbar/build
devenv zbar.sln /Build
  1. done

ssrlive avatar Sep 12 '21 05:09 ssrlive

Followed the steps, but, I get a lot, and I mean a lot

Build log: log.txt

you must cd C:\Dev\zbar\build and run cmake.

ssrlive avatar Sep 12 '21 13:09 ssrlive

Hello, is it possible compile for win32?

EliaTolin avatar Nov 19 '21 08:11 EliaTolin

Yes https://github.com/ShadowsocksR-Live/zbar/blob/master/README-windows.md#building-with-cmake-on-windows @EliaTolin

ssrlive avatar Nov 19 '21 11:11 ssrlive

Yes https://github.com/ShadowsocksR-Live/zbar/blob/master/README-windows.md#building-with-cmake-on-windows @EliaTolin

Yes but i need the version x86, not x64. Is it a fork with x86?

EliaTolin avatar Nov 19 '21 13:11 EliaTolin

https://stackoverflow.com/questions/28350214/how-to-build-x86-and-or-x64-on-windows-from-command-line-with-cmake

ssrlive avatar Nov 19 '21 13:11 ssrlive

Thanks so much!

EliaTolin avatar Nov 19 '21 13:11 EliaTolin

@ssrlive Please create a PR to this repo for CMake support. Thanks!

rollingmoai avatar Jul 20 '22 07:07 rollingmoai

Hey @ssrlive I tried your cmake method in MSYS2 in windows 10 I got this error.

[ 50%] Building C object CMakeFiles/zbar.dir/zbar/video/v4l.c.obj
[ 52%] Building C object CMakeFiles/zbar.dir/zbar/video/v4l2.c.obj
/c/Users/princ/Downloads/projects/freelancing/fiverr/trash/zbar/zbar/video/v4l2.c:50:10: fatal error: linux/videodev2.h: No such file or directory
   50 | #include <linux/videodev2.h>
      |          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/zbar.dir/build.make:370: CMakeFiles/zbar.dir/zbar/video/v4l2.c.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:87: CMakeFiles/zbar.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

sc0rp10n-py avatar Nov 04 '22 10:11 sc0rp10n-py

Please use Visual Studio 2019.

ssrlive avatar Nov 04 '22 10:11 ssrlive

@ssrlive I got this error while installing vcpkg

vcpkg install libjpeg-turbo libjpeg-turbo:x64-windows

error

-- Configuring x64-windows
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:96 (message):
    Command failed: C:/vcpkg/downloads/tools/ninja/1.10.2-windows/ninja.exe -v
    Working Directory: C:/vcpkg/buildtrees/libjpeg-turbo/x64-windows-rel/vcpkg-parallel-configure
    Error code: 1
    See logs for more information:
      C:\vcpkg\buildtrees\libjpeg-turbo\config-x64-windows-CMakeCache.txt.log
      C:\vcpkg\buildtrees\libjpeg-turbo\config-x64-windows-CMakeCache.txt.log
      C:\vcpkg\buildtrees\libjpeg-turbo\config-x64-windows-out.log

Call Stack (most recent call first):
  installed/x64-windows/share/vcpkg-cmake/vcpkg_cmake_configure.cmake:247 (vcpkg_execute_required_process)
  ports/libjpeg-turbo/portfile.cmake:40 (vcpkg_cmake_configure)
  scripts/ports.cmake:147 (include)


error: building libjpeg-turbo:x64-windows failed with: BUILD_FAILED
error: Please ensure you're using the latest port files with `git pull` and `vcpkg update`.
Then check for known issues at:
    https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+libjpeg-turbo
You can submit a new issue at:
    https://github.com/microsoft/vcpkg/issues/new?template=report-package-build-failure.md&title=[libjpeg-turbo]+Build+error
Include '[libjpeg-turbo] Build error' in your bug report title, the following version information in your bug description, and attach any relevant failure logs from above.
    vcpkg-tool version: 2022-10-17-3247920fbdd47d08f36cbd480addd9890d3c2435
    vcpkg-scripts version: a4013afe6 2022-11-03 (13 hours ago)

sc0rp10n-py avatar Nov 04 '22 11:11 sc0rp10n-py