jimevins / glabels-qt

gLabels Label Designer (Qt/C++)
http://glabels.org
GNU General Public License v3.0
324 stars 89 forks source link

GLABELS-QT on Windows 10 with lib ZINT or GNU-BARCODE - Code128 #177

Open krebsi83 opened 2 years ago

krebsi83 commented 2 years ago

Is there a way to compile GLABELS-QT on Windows 10 with lib ZINT or GNU-BARCODE (http://gnuwin32.sourceforge.net/packages/barcode.htm)? I need Code128, but unfortunately I can't get it to work. Best regards and many thanks. Krebsi83

jmb26240 commented 2 years ago

I am also interested in learning how to compile GLABELS with the ZINT library. Best regards.

jmb

PakoTrist commented 1 year ago

Have some problem with compiling in windows 10? anybody help ?

innominate1 commented 1 year ago

gLabels for Windows Build Instructions, a (very) rough guide


Install Software

Install; Visual Studio 2022 CMake 3.27.0 qt-opensource-windows-x86-5.12.12.exe NSIS 3.09 Git-2.42.0.2-64-bit.exe

Add to PATH; c:\Program Files\CMake\bin c:\Qt\Qt5.12.12\5.12.12\msvc2017_64\bin

Get Source

Open Git Bash terminal;

mkdir ~/workspace && cd ~/workspace
git clone https://github.com/jimevins/glabels-qt.git glabels-qt
git clone https://github.com/Microsoft/vcpkg.git vcpkg

Download https://master.dl.sourceforge.net/project/zint/zint/2.6.7/zint-2.6.7.tar.gz Extract to workspace/zint

Install libqrencode

cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install libqrencode:x64-windows

Build libzint

Open workspace\zint\win32\zint.sln in Visual Studio 2022

Retarget Projects

Select Release Configuration

Right click libzint project in Solution Explorer, open Properties

Right-click libzint project, and add ~/workspace/zint/backend/ultra.c

Build Solution

Build gLabels

Add following lines to ~/workspace/glabels-qt/CMakeLists.txt, before line <find_package (ZLIB 1.2 QUIET)>;

set (ZLIB_LIBRARY "C:/Users/User/workspace/vcpkg/installed/x64-windows/lib/zlib.lib")
set (ZLIB_INCLUDE_DIR "C:/Users/User/workspace/vcpkg/installed/x64-windows/include/")

set (LIBQRENCODE_LIBRARY "C:/Users/User/workspace/vcpkg/installed/x64-windows/lib/qrencode.lib")
set (LIBQRENCODE_INCLUDE_DIR "C:/Users/User/workspace/vcpkg/installed/x64-windows/include/")

set (LIBZINT_LIBRARY "C:/Users/User/workspace/zint/win32/x64/Release/libzint.lib")
set (LIBZINT_INCLUDE_DIR "C:/Users/User/workspace/zint/backend/")
cd .\workspace\glabels-qt\
mkdir build
cd build
cmake -G "Visual Studio 17 2022" -DCMAKE_PREFIX_PATH="C:\Qt\Qt5.12.12\5.12.12\msvc2017_64" ..
cmake --build . --config Release

Copy ~/workspace/zint/win32/x64/Release/libzint.dll, to ~/workspace/glabels-qt/build/glabels/Release/ folder

Create installer

cd .\workspace\glabels-qt\build
cpack -C Release -G NSIS


CMake Configuration

-- Project name ............ glabels-qt
-- Project version ......... 3.99-master564 (2da9b2d 2021-02-06)
-- Installation prefix ..... C:/Program Files (x86)/glabels-qt
-- Source code location .... C:/Users/User/workspace/glabels-qt/glabels
-- CMake version ........... 3.27.0
-- C++ Compiler ............ MSVC C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.33.31629/bin/Hostx64/x64/cl.exe 19.33.31629.0
-- Qt version .............. 5.12.12
-- zlib (optional).......... 1.3.0
-- GNU Barcode (optional)... No.
-- qrencode (optional)......
-- libzint (optional)....... 2.6.7
-- QtTest (optional)........ 5.12.12
-- MSVC Qt location ........

TODO

Download BarCode for Windows from https://gnuwin32.sourceforge.net/packages/barcode.htm Build GNU Barcode for x86-64 Add to ~/workspace/glabels-qt/CMakeLists.txt;

set (GNUBARCODE_LIBRARY "../barcode.lib")
set (GNUBARCODE_INCLUDE_DIR "../include/")

Also examine Ultracode Support

Notes

Installer quarantined by Windows Security/ Anti-Virus software due to false positive.

schweini commented 8 months ago

Does anyone have a Windows binary with these more extensive barcode libs available? The binary in "releases" just supports one or two barcode types.