File: README

package info (click to toggle)
zint 2.15.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 23,016 kB
  • sloc: ansic: 133,002; cpp: 8,153; php: 1,846; sh: 1,304; python: 307; makefile: 207; tcl: 74
file content (268 lines) | stat: -rw-r--r-- 7,581 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
% win32/README 2024-01-18

Visual Studio 2022
------------------

To build the Zint library DLL and the command line tool "zint.exe" with PNG
support for x86/Win32:

Install git (https://git-scm.com/downloads)
Install cmake (https://cmake.org/download/)

Open a "Developer Command Prompt for VS 2022" (should be available under the
"Visual Studio 2022" tab in the Start menu).

Make sure git and cmake are in your PATH, e.g. (your paths may differ)

  set "PATH=C:\Program Files\Git\cmd;%PATH%"
  set "PATH=C:\Program Files\CMake\bin;%PATH%"

Download zint, zlib and libpng by going to the directory you want to clone them
into:

  cd <project-directory>

and cloning each:

  git clone https://git.code.sf.net/p/zint/code zint
  git clone https://git.code.sf.net/p/libpng/code lpng
  git clone https://github.com/madler/zlib.git zlib

First build zlib:

  cd zlib
  nmake -f win32\Makefile.msc clean
  nmake -f win32\Makefile.msc
  cd ..

and then lpng:

  cd lpng
  nmake -f scripts\makefile.vcwin32 clean
  nmake -f scripts\makefile.vcwin32
  cd ..

If you now open "%cd%\zint\win32\zint.sln" with Visual Studio 2022, you
should be able to build the Release configuration for Win32.

"zint.dll" and "zint.exe" will be in "zint\win32\Release".

To build Zint Studio ("qtZint.exe"), you need to have Qt installed, which
involves signing up for a Qt account and installing the Qt Maintenance Tool.
(https://www.qt.io/download-qt-installer)
Using this tool you can install various versions of Qt and various optional
components.

The following requires the "MSVC 2019 32-bit" component to be installed.

As of writing Qt 5.15.2 is the latest release that includes this component and
is used here. Add the location of this component to your PATH, e.g. (your path
may differ):

  set "PATH=C:\Qt\5.15.2\msvc2019\bin;%PATH%"

Next build the Zint backend Qt library "QtZintDLL.lib":

  cd zint\backend_qt
  qmake backend_qt_zintdll.pro
  nmake clean
  nmake release
  cd ..\..

Then Zint Studio "qtZint.exe":

  cd zint\frontend_qt
  qmake frontend_qt_zintdll.pro
  nmake clean
  nmake release
  cd ..\..

This creates "zint\frontend_qt\release\qtZint.exe". It requires the Zint DLL to
run, so add its location to your PATH:

  set "PATH=%cd%\zint\win32\Release;%PATH%"

You should now be able to run Zint Studio:

  zint\frontend_qt\release\qtZint


Visual Studio 2019 and 2017
---------------------------

Solutions for Visual Studio 2019 and 2017 are in sub-directories vs2019 and
vs2017. The steps are the same as for Visual Studio 2022.


Visual Studio 2015
------------------

A solution for Visual Studio 2015 is in sub-directory vs2015. The steps are
almost the same as for Visual Studio 2022, except that "rc.exe" may not be
available. If so, you need to install a Windows Kit and then update your PATH,
e.g. (adjust for version):

  set "PATH=C:\Program Files (x86)\Windows Kits\10\bin\10.0.20348.0\x86;%PATH%"

Recent versions of Qt no longer supply a specific component for Visual Studio
2015 32-bit, but you can use "MSVC 2019 32-bit" instead as it's compatible.

For information on building a standalone version of Zint Studio using Visual
Studio 2015, see "frontend_qt\howto_build_qzint_using_msvs2015.txt"


CMake and Visual Studio
-----------------------

Zint can also be built using CMake with Visual Studio 2022, 2019, 2017 or 2015.
The following example uses Visual Studio 2019 to build for x86/Win32:

As above, follow the steps to build zlib and lpng.

CMake needs to be able to find zlib and lpng. One way to do this (requires
Administrator privileges) is to create two sub-directories in
"C:\Program Files (x86)" called "include" and "lib", and then copy

  "zlib\zlib.h", "zlib\zconf.h", "lpng\png.h", "lpng\pngconf.h" and
  "lpng\pnglibconf.h" into "include", and

  "zlib\zlib.lib" and "lpng\libpng.lib" into "lib".

This example uses Qt 5.15.2 and component "MSVC 2019 32-bit" so install them and
add to path (your path may differ):

  set "PATH=C:\Qt\5.15.2\msvc2019\bin;%PATH%"

Now build zint:

  cd zint
  cmake -G "Visual Studio 16 2019" -A Win32 -DCMAKE_BUILD_TYPE=Release -B build
  cmake --build build --config Release
  cd ..

You should be able to run zint CLI and Zint Studio:

  set "PATH=%cd%\zint\build\backend\Release;%PATH%"
  zint\build\frontend\Release\zint.exe
  zint\build\frontend_qt\Release\zint-qt.exe

Note that the program name for Zint Studio when built using CMake is not
"qtZint.exe" but "zint-qt.exe".

For MSVC 2015 32-bit, MSVC 2017 32-bit and MSVC 2022 32-bit, the zint cmake
equivalents are:

  cmake -G "Visual Studio 14 2015" -DCMAKE_BUILD_TYPE=Release -B build
  cmake -G "Visual Studio 15 2017" -DCMAKE_BUILD_TYPE=Release -B build
  cmake -G "Visual Studio 17 2022" -A Win32 -DCMAKE_BUILD_TYPE=Release -B build


Visual C++ 6
------------

The zint library and command line tool can be built using VC6.

See "win32\zint_cmdline_vc6\readme.txt"


MinGW/MSYS
----------

If not already installed, download and run the MinGW Installation Manager setup
(https://osdn.net/projects/mingw/downloads/68260/mingw-get-setup.exe/) and
using it install the packages:

  mingw-developer-toolkit-bin
  mingw32-base-bin
  mingw32-gcc-g++-bin
  msys-base-bin

(This should include mingw32-libz-dll)

Any reasonably modern version of Qt can be used. The following uses Qt 5.15.2.
Using the Qt Maintenance Tool (see the Visual Studio 2022 instructions above)
install the "MinGW 8.1.0 32-bit" component.

(Note the Qt MinGW versions actually refer to Mingw-w64, the 64-bit fork of
MinGW, but versions up to 8.1.0 at least are compatible.)

Open a MinGW/MSYS shell by clicking/running e.g. (your path may differ)

  C:\MinGW\msys\1.0\msys.bat

As above make sure git and cmake are in your PATH.

Add the Qt MinGW 8.1.0 32-bit component to your PATH, e.g. (your path may
differ):

  export PATH="/c/Qt/5.15.2/mingw81_32/bin":${PATH}

Go into the directory you want to use and clone zint and libpng:

  cd <project-directory>

  git clone https://git.code.sf.net/p/zint/code zint
  git clone https://git.code.sf.net/p/libpng/code lpng

To compile lpng on MSYS, a bit of fiddling is needed. Go to the directory:

  cd lpng

On Windows git usually converts UNIX line endings to DOS ones. Undo this:

  dos2unix * scripts/*

Attempt to do the usual GNU make:

  ./configure
  make

This will fail with a syntax error. To fix:

  sed -i 's/\r//' pnglibconf.h

(ignore "preserving permissions" warning if any)

And then do the make again:

  make
  make install

  cd ..

The lpng includes should be in "/usr/local/include". Tell gcc to search there by
setting C_INCLUDE_PATH:

  export C_INCLUDE_PATH=/usr/local/include

Now we should be able to build zint normally, except for telling cmake to
generate MSYS compatible makefiles:

  cd zint

  mkdir build
  cd build
  cmake -G "MSYS Makefiles" ..
  make

  cd ../..

This creates:

zint/build/backend/libzint.dll
zint/build/frontend/zint.exe
zint/build/backend_qt/libQZint.lib
zint/build/frontend_qt/zint-qt.exe

The Zint command line tool "zint.exe" and Zint Studio "zint-qt.exe" need
"libzint.dll" to run so add its location to your PATH:

  export PATH="$(pwd)/zint/build/backend":${PATH}

You should now be able to run the command line tool:

  zint/build/frontend/zint

And Zint Studio:

  zint/build/frontend_qt/zint-qt