├── images ├── johndoe.png ├── johndoe-name.png └── johndoe-phone.png ├── modulefiles └── ptouch-print │ └── 1.5.lua ├── LICENSE └── README.md /images/johndoe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HenrikBengtsson/brother-ptouch-label-printer-on-linux/HEAD/images/johndoe.png -------------------------------------------------------------------------------- /images/johndoe-name.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HenrikBengtsson/brother-ptouch-label-printer-on-linux/HEAD/images/johndoe-name.png -------------------------------------------------------------------------------- /images/johndoe-phone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HenrikBengtsson/brother-ptouch-label-printer-on-linux/HEAD/images/johndoe-phone.png -------------------------------------------------------------------------------- /modulefiles/ptouch-print/1.5.lua: -------------------------------------------------------------------------------- 1 | help([[ 2 | ptouch-print: Print Labels on Brother P-touch Printers on Linux 3 | ]]) 4 | 5 | local name = myModuleName() 6 | local version = myModuleVersion() 7 | whatis("Version: " .. version) 8 | whatis("Keywords: tools, printing") 9 | whatis("URL: https://dominic.familie-radermacher.ch/projekte/ptouch-print/, https://github.com/HenrikBengtsson/brother-ptouch-label-printer-on-linux (docs), https://git.familie-radermacher.ch/linux/ptouch-print.git (source code)") 10 | whatis([[ 11 | Description: Print labels on Brother P-touch printers on Linux. 12 | Examples: `print-touch --help`, `print-touch --version`, and `man print-touch`. 13 | ]]) 14 | 15 | local root = os.getenv("SOFTWARE_ROOT_MANUAL") 16 | local home = pathJoin(root, name .. "-" .. version) 17 | 18 | prepend_path("PATH", pathJoin(home, "bin")) 19 | prepend_path("MANPATH", pathJoin(home, "share", "man")) 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Henrik Bengtsson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Use Brother P-touch Label Printer on Linux 2 | 3 | _NOTE: These are my notes on how to use the `ptouch-print` tool. I am 4 | **not** the author of `ptouch-print` 5 | () /Henrik 6 | 2024-05-04_ 7 | 8 | 9 | These are my notes on how to use a Brother P-touch D450 ([PT-D450]) 10 | from Linux, which is connected via USB. They are written around the 11 | **[ptouch-print]** command-line tool for communicating with the label 12 | printer. 13 | 14 | ## Gist 15 | 16 | * The label printer is connected to the computer via a USB A-to-Micro 17 | B cable. 18 | 19 | * **ptouch-print** communicates with the printer directly over 20 | USB. There is no need to install printer drivers (but Ubuntu might 21 | still do so). 22 | 23 | * **ptouch-print** can send a monochrome PNG file to the label 24 | printer. 25 | 26 | * **ptouch-print** can generate a monochrome PNG file from a sequence 27 | of multi-line plain text, images, and padding command-line options. 28 | 29 | * **ptouch-print** can send the sequence directly to the label 30 | printer, but it's hard to predict what it will look like. Better to 31 | always output to a PNG for preview. 32 | 33 | * **ptouch-print** can handle multiple monochrome PNG files as input, 34 | e.g. either to be print one after each other or to output a new 35 | monochrome PNG file. You can add separation by adding `--pad 36 | ` between each `--image ` option. 37 | 38 | * There will always be 20-30 mm of blank tape wasted at the very front 39 | of each print when using these printers. For the PT-D450, it's 23 40 | mm. This is because the (manual) cutter is this distance away from 41 | the print head. It's physically impossible to avoid this and has 42 | nothing to do which printer software you use. To save label tape, try 43 | to print multiple labels (images) per print. 44 | 45 | * **ptouch-print** can merge multiple monochrome PNG images into one 46 | long PNG image, which helps save tape. 47 | 48 | * **ptouch-print** needs to build from source, which is 49 | straightforward if basic compile tools are already installed. 50 | 51 | 52 | 53 | ## Usage 54 | 55 | ```sh 56 | $ ptouch-print --help 57 | usage: ptouch-print [options] 58 | options: 59 | --debug enable debug output 60 | --font use font or 61 | --fontsize Manually set fontsize 62 | --writepng instead of printing, write output to png file 63 | print commands: 64 | --image print the given image which must be a 2 color 65 | (black/white) png 66 | --text Print 1-4 lines of text. 67 | If the text contains spaces, use quotation marks 68 | around it. 69 | --cutmark Print a mark where the tape should be cut 70 | --pad Add n pixels padding (blank tape) 71 | other commands: 72 | --version show version info (required for bug report) 73 | --info show info about detected tape 74 | --list-supported show printers supported by this version 75 | ``` 76 | 77 | 78 | 79 | ## Supported label printers 80 | 81 | ```sh 82 | $ ptouch-print --version 83 | ptouch-print version v1.5.r20.ga51fcf9 by Dominic Radermacher 84 | 85 | $ ptouch-print --list-supported 86 | Supported printers (some might have quirks) 87 | PT-2420PC 88 | PT-2450PC 89 | PT-1950 90 | PT-2700 91 | PT-1230PC 92 | PT-2430PC 93 | PT-2730 94 | PT-H500 95 | PT-E500 96 | PT-P700 97 | PT-P750W 98 | PT-D410 99 | PT-D450 100 | PT-D460BT 101 | PT-D600 102 | PT-D610BT 103 | PT-P710BT 104 | ``` 105 | 106 | 107 | ## Examples 108 | 109 | ### Query printer for information 110 | 111 | ```sh 112 | $ ptouch-print --info 113 | PT-D450 found on USB bus 1, device 8 114 | maximum printing width for this tape is 120px 115 | media type = 01 (Laminated tape) 116 | media width = 18 mm 117 | tape color = 01 (White) 118 | text color = 08 (Black) 119 | error = 0000 120 | ``` 121 | 122 | ### Pre-generate PNG image 123 | 124 | ```sh 125 | $ ptouch-print --text "John Doe" --writepng johndoe-name.png 126 | PT-D450 found on USB bus 1, device 8 127 | choosing font size=94 128 | 129 | $ file johndoe-name.png 130 | johndoe.png: PNG image data, 569 x 120, 1-bit colormap, non-interlaced 131 | ``` 132 | 133 | 134 | 135 | 136 | ```sh 137 | $ ptouch-print --text "John Doe" "+1 123-456-7890" --writepng johndoe-phone.png 138 | PT-D450 found on USB bus 1, device 8 139 | choosing font size=48 140 | 141 | $ file johndoe-phone.png 142 | johndoe-phone.png: PNG image data, 561 x 120, 1-bit colormap, non-interlaced 143 | ``` 144 | 145 | 146 | 147 | 148 | ```sh 149 | $ ptouch-print --text "John Doe" "john.doe@example.org" "+1 123-456-7890" --writepng johndoe.png 150 | PT-D450 found on USB bus 1, device 11 151 | choosing font size=32 152 | 153 | $ file johndoe.png 154 | johndoe-all.png: PNG image data, 493 x 120, 1-bit colormap, non-interlaced 155 | ``` 156 | 157 | 158 | 159 | 160 | 161 | Note that `ptouch-print` has to be able to communicate with the 162 | printer even if it is only generating a PNG file. 163 | 164 | 165 | ### Print PNG image 166 | 167 | ```sh 168 | $ ptouch-print --image johndoe.png 169 | PT-D450 found on USB bus 1, device 11 170 | max_pixels=128, offset=4 171 | ``` 172 | 173 | ### Print multiple PNG images at once (saves tape) 174 | 175 | The label printer will always feed the tape forward after each print 176 | so that the cutter won't cut into the printed content. If you print 177 | many labels, one by one, this way, you end up wasting a lot of label 178 | tape. To avoid this, you can print multiple labels at the same time. 179 | For example, 180 | 181 | ```sh 182 | $ ptouch-print --image alice.png --pad 10 --image bob.png --pad 10 --image carol.png 183 | qPT-D450 found on USB bus 1, device 11 184 | max_pixels=128, offset=4 185 | ``` 186 | 187 | ## Man pages 188 | 189 | 190 | 191 | ```sh 192 | PTOUCH-PRINT(1) ptouch printer util PTOUCH-PRINT(1) 193 | 194 | NAME 195 | ptouch-print - a command line tool to use Brother Ptouch label 196 | printers 197 | 198 | SYNOPSIS 199 | ptouch-print [options] 200 | 201 | DESCRIPTION 202 | ptouch-print is a command line tool that can be used to print 203 | labels with several Brother Ptouch label printers. 204 | 205 | OPTIONS 206 | General options, font selection options and optput options are 207 | valid for the whole printout and should be given only once. 208 | Each duplication will override the previous argument value. 209 | 210 | Any of the printing command options can be given more than once 211 | in any order, and will be executed in the given order. 212 | 213 | General options 214 | --debug 215 | Enables printing of debugging information. 216 | 217 | Font selection options 218 | --fontsize 219 | Disable auto-detection of the font size and force the 220 | font size to the size given as argument. Please note 221 | that text will be cut off if you specify a too large 222 | font size here. 223 | 224 | --font 225 | Set the font to the fontname given as argument. 226 | 227 | Output control options 228 | --writepng 229 | Instead of printing to the label printer, write the out‐ 230 | put in a PNG image file (which can be printed later us‐ 231 | ing the --image printing command option). 232 | 233 | Printing command options 234 | --text text 235 | Print the given text at the current position. Text in‐ 236 | cluding spaces must be enclosed in question marks. To 237 | print a text in multiple lines, give multiple text argu‐ 238 | ments. Also see the EXAMPLES section. 239 | 240 | --image image.png 241 | Print the image file at the current position. The image 242 | file must be a two color, palette based image in PNG 243 | format. 244 | 245 | --cutmark 246 | Print a cutmark (dashed line) at the current position. 247 | 248 | --pad 249 | Print pixels of white space at the current position. 250 | Useful for printers that would otherwise cut off parts 251 | of the printed text or image. 252 | 253 | Getting help and display information 254 | -?, --help 255 | Print a help message and exit. 256 | 257 | --version 258 | Display version information and exit. 259 | 260 | --info Show info about the tape detected (like printing width 261 | etc.) and exit. 262 | 263 | --list-supported 264 | List all supported printers 265 | 266 | DEFAULTS 267 | The default font used is 'DejaVuSans'. 268 | 269 | The default fontsize is auto-detected, depending on the used 270 | tape width and font. 271 | 272 | EXIT STATUS 273 | 0 Successful program execution. 274 | 275 | 1 Usage syntax error. 276 | 277 | 5 Printer device could not been opened. 278 | 279 | EXAMPLES 280 | ptouch-print --text 'Hello World' 281 | Print the text 'Hello World' in one line 282 | 283 | ptouch-print --text 'Hello' 'World' 284 | Print the text 'Hello World' in two lines ('Hello' in 285 | the first line and 'World' in the second line). 286 | 287 | ptouch-print --image icon.png 288 | Print the image contained in the PNG image file 289 | 'icon.png'. The image file must be palette based PNG 290 | format with two colors. 291 | 292 | AUTHOR 293 | Written by Dominic Radermacher (dominic@familie-raderma‐ 294 | cher.ch). 295 | 296 | Also see https://dominic.familie-radermacher.ch/pro‐ 297 | jekte/ptouch-print/ 298 | 299 | 1.5 2023-03-13 PTOUCH-PRINT(1) 300 | ``` 301 | 302 | 303 | ## Installation 304 | 305 | ### Requirements 306 | 307 | Installation requirements: 308 | 309 | * Linux 310 | * Administrative permissions - for setting the [SUID flag] on the built 311 | `ptouch-print` executable so that any user can run it without `sudo` 312 | * C compiler, e.g. GCC 313 | * [CMake] (on Debian/Ubuntu/Pi OS: `sudo apt install cmake`; RedHat/Fedora: `sudo yum install cmake`) 314 | * [gettext] (on Debian/Ubuntu/Pi OS: `sudo apt install gettext`; RedHat/Fedora: `sudo yum install gettext`) 315 | * [LibGD] (on Debian/Ubuntu/Pi OS: `sudo apt install libgd-dev`; RedHat/Fedora: `sudo yum install gd-devel`) 316 | * [libusb] v1.0 (on Debian/Ubuntu/Pi OS: `sudo apt install libusb-1.0-0-dev`; RedHat/Fedora: `sudo yum install libusb-devel`) 317 | * ...? 318 | 319 | 320 | Run-time requirements: 321 | 322 | * Linux 323 | * Non-privileged user rights (requires setting SUID flag) 324 | 325 | 326 | 327 | ### Build 328 | 329 | ```sh 330 | $ git clone https://git.familie-radermacher.ch/linux/ptouch-print.git 331 | $ cd ptouch-print 332 | $ ./build.sh 333 | -- The C compiler identification is GNU 12.2.0 334 | ... 335 | [100%] Linking C executable ptouch-print 336 | [100%] Built target ptouch-print 337 | 338 | $ ls -l build/ptouch-print 339 | -rwxr-xr-x 1 pi pi 64328 May 5 06:23 build/ptouch-print 340 | 341 | $ build/ptouch-print --version 342 | ptouch-print version v1.5.r20.ga51fcf9 by Dominic Radermacher 343 | ``` 344 | 345 | 346 | 347 | ### Install 348 | 349 | #### System-wide installation 350 | 351 | Simply invoke make: 352 | 353 | ```sh 354 | $ sudo make -C build/ install 355 | ``` 356 | 357 | This installs `ptouch-print` centrally on the machine, and loads 358 | [udev] rules to grant access to USB devices, so that `ptouch-print` 359 | can be used without `sudo`. 360 | 361 | 362 | #### User installation 363 | 364 | If you do not want to install `ptouch-print` system-wide, you can 365 | copy the executable and manual files as the current user in the 366 | desired destination: 367 | 368 | ```sh 369 | $ prefix=$HOME/software/ptouch-print 370 | $ mkdir -p "$prefix"/{bin,share/man/man1} 371 | $ cp build/ptouch-print "$prefix/bin/" 372 | $ cp ptouch-print.1 "$prefix/share/man/man1" 373 | ``` 374 | 375 | Then install the [udev] rules, and load them to grant users access to 376 | USB devices: 377 | 378 | ```sh 379 | $ sudo cp udev/90-usb-ptouch-permissions.rules /etc/udev/rules.d/ 380 | $ sudo udevadm control --reload-rules 381 | ``` 382 | 383 | _Comment_: You might have to reboot the machine, before this works. 384 | 385 | 386 | Update `PATH` and `MANPATH` as below, e.g. in `~/.bashrc`. 387 | 388 | ```sh 389 | $ prefix=$HOME/software/ptouch-print 390 | $ PATH="$prefix/bin:$PATH" 391 | $ MANPATH="$prefix/share/man:$MANPATH" 392 | ``` 393 | 394 | Alternative, if you have [Lmod] set up, you can copy 395 | [modulefiles/ptouch-print/1.5.lua] to your `MODULEPATH` and just do: 396 | 397 | ```sh 398 | $ module load ptouch-print 399 | ``` 400 | 401 | With this in place, the executable and the manual page should be 402 | found; 403 | 404 | ```sh 405 | $ command -v ptouch-print 406 | /home/alice/software/ptouch-print/bin/ptouch-print 407 | $ man -w ptouch-print 408 | /home/alice/software/ptouch-print/share/man/man1/ptouch-print.1 409 | ``` 410 | 411 | 412 | 413 | 414 | ## Troubleshooting 415 | 416 | If you get: 417 | 418 | ```sh 419 | $ build/ptouch-print --info 420 | PT-D450 found on USB bus 1, device 8 421 | libusb_open error :LIBUSB_ERROR_ACCESS 422 | ``` 423 | 424 | This is due to lack of permissions to access the printer over USB. 425 | The user executing the `ptouch-print` command needs to granted 426 | access rights, which can be done by installing udev rules as explained above. 427 | An alternative can be done by prefixing the call using `sudo`, e.g. `sudo 428 | build/ptouch-print --info`. 429 | Note: using udev rules is more secure as the binary file may be altered to 430 | perform malicious thing. 431 | 432 | 433 | ## Appendix 434 | 435 | ### Installation log 436 | 437 | ```sh 438 | $ cmake --version | head -1 439 | cmake version 3.25.1 440 | 441 | CMake suite maintained and supported by Kitware (kitware.com/cmake). 442 | 443 | $ $ git log -1 | head -3 444 | commit a51fcf98f879b2505ea002d9b7385ba143c2febc 445 | Author: Dominic Radermacher 446 | Date: Thu Apr 18 09:29:38 2024 +0200 447 | 448 | $ ./build.sh 449 | -- The C compiler identification is GNU 12.2.0 450 | -- Detecting C compiler ABI info 451 | -- Detecting C compiler ABI info - done 452 | -- Check for working C compiler: /usr/bin/cc - skipped 453 | -- Detecting C compile features 454 | -- Detecting C compile features - done 455 | -- Found Gettext: /usr/bin/msgmerge (found version "0.21") 456 | Found GD: YES 457 | -- Looking for gdImagePng in /usr/lib/arm-linux-gnueabihf/libgd.so 458 | -- Looking for gdImagePng in /usr/lib/arm-linux-gnueabihf/libgd.so - found 459 | -- Found ZLIB: /usr/lib/arm-linux-gnueabihf/libz.so (found version "1.2.13") 460 | -- Found PNG: /usr/lib/arm-linux-gnueabihf/libpng.so (found version "1.6.39") 461 | -- Looking for gdImageJpeg in /usr/lib/arm-linux-gnueabihf/libgd.so 462 | -- Looking for gdImageJpeg in /usr/lib/arm-linux-gnueabihf/libgd.so - found 463 | -- Found JPEG: /usr/lib/arm-linux-gnueabihf/libjpeg.so (found version "62") 464 | -- Looking for gdImageGif in /usr/lib/arm-linux-gnueabihf/libgd.so 465 | -- Looking for gdImageGif in /usr/lib/arm-linux-gnueabihf/libgd.so - found 466 | -- Found GD: /usr/lib/arm-linux-gnueabihf/libgd.so 467 | -- Found Git: /usr/bin/git (found version "2.39.2") 468 | -- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.1") 469 | -- Found Intl: built in to C library 470 | -- Checking for module 'libusb-1.0' 471 | -- Found libusb-1.0, version 1.0.26 472 | -- Configuring done 473 | -- Generating done 474 | -- Build files have been written to: /home/pi/repositories/other/ptouch-print/build 475 | -- Found Git: /usr/bin/git (found version "2.39.2") 476 | [ 0%] Built target git-version 477 | [ 33%] Building C object CMakeFiles/ptouch-print.dir/src/libptouch.c.o 478 | In file included from /home/pi/repositories/other/ptouch-print/src/libptouch.c:30: 479 | /home/pi/repositories/other/ptouch-print/src/libptouch.c: In function ‘ptouch_send’: 480 | /home/pi/repositories/other/ptouch-print/include/gettext.h:67:41: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘size_t’ {aka ‘unsigned int’} [-Wformat=] 481 | 67 | # define gettext(Msgid) ((const char *) (Msgid)) 482 | | ^ 483 | /home/pi/repositories/other/ptouch-print/src/libptouch.c:33:14: note: in expansion of macro ‘gettext’ 484 | 33 | #define _(s) gettext(s) 485 | | ^~~~~~~ 486 | /home/pi/repositories/other/ptouch-print/src/libptouch.c:182:33: note: in expansion of macro ‘_’ 487 | 182 | fprintf(stderr, _("write error: could send only %i of %ld bytes\n"), tx, len); 488 | | ^ 489 | [ 66%] Building C object CMakeFiles/ptouch-print.dir/src/ptouch-print.c.o 490 | /home/pi/repositories/other/ptouch-print/src/ptouch-print.c: In function ‘print_img’: 491 | /home/pi/repositories/other/ptouch-print/src/ptouch-print.c:95:30: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘size_t’ {aka ‘unsigned int’} [-Wformat=] 492 | 95 | printf("max_pixels=%ld, offset=%d\n", max_pixels, offset); 493 | | ~~^ ~~~~~~~~~~ 494 | | | | 495 | | long int size_t {aka unsigned int} 496 | | %d 497 | In file included from /home/pi/repositories/other/ptouch-print/src/ptouch-print.c:32: 498 | /home/pi/repositories/other/ptouch-print/src/ptouch-print.c: In function ‘main’: 499 | /home/pi/repositories/other/ptouch-print/include/gettext.h:88:25: warning: statement with no effect [-Wunused-value] 500 | 88 | ((void) (Domainname), (const char *) (Dirname)) 501 | | ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ 502 | /home/pi/repositories/other/ptouch-print/src/ptouch-print.c:512:9: note: in expansion of macro ‘bindtextdomain’ 503 | 512 | bindtextdomain("ptouch-print", "/usr/share/locale/"); 504 | | ^~~~~~~~~~~~~~ 505 | /home/pi/repositories/other/ptouch-print/include/gettext.h:85:34: warning: statement with no effect [-Wunused-value] 506 | 85 | # define textdomain(Domainname) ((const char *) (Domainname)) 507 | | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~ 508 | /home/pi/repositories/other/ptouch-print/src/ptouch-print.c:513:9: note: in expansion of macro ‘textdomain’ 509 | 513 | textdomain("ptouch-print"); 510 | | ^~~~~~~~~~ 511 | [100%] Linking C executable ptouch-print 512 | [100%] Built target ptouch-print 513 | ``` 514 | 515 | ### Getting compilation errors? 516 | 517 | 518 | #### Compilation error: Could not find GD library 519 | 520 | If `./build.sh` produces: 521 | 522 | ```sh 523 | Found GD: NO 524 | CMake Error at cmake/FindGD.cmake:109 (MESSAGE): 525 | Could not find GD library 526 | ``` 527 | 528 | then make sure to install [LibGD] (see above). 529 | 530 | 531 | #### Compilation error: No package 'libusb-1.0' found 532 | 533 | If `./build.sh` produces: 534 | 535 | ```sh 536 | -- Checking for module 'libusb-1.0' 537 | -- No package 'libusb-1.0' found 538 | 539 | CMake Error at /usr/share/cmake-3.22/Modules/FindPkgConfig.cmake:603 (message): 540 | A required package was not found 541 | ``` 542 | 543 | then make sure to install [libusb] (see above). 544 | 545 | 546 | #### Too old cmake version 547 | 548 | If you get the following error when compiling: 549 | 550 | ```sh 551 | CMake Error: The following variables are used in this project, but they are set to NOTFOUND. 552 | Please set them or make sure they are set and tested correctly in the CMake files: 553 | Intl_LIBRARY (ADVANCED) 554 | linked by target "ptouch-print" in directory /home/alice/repositories/other/ptouch-print 555 | 556 | -- Configuring incomplete, errors occurred! 557 | See also "/home/alice/repositories/other/ptouch-print/build/CMakeFiles/CMakeOutput.log". 558 | ``` 559 | 560 | you need to update CMake. I got the above error on Ubuntu 20.04 (April 561 | 2020), which comes with cmake 3.16.3. After [installing cmake] 3.25.1, 562 | and wiping the `build/` folder, the compilation succeeded. 563 | 564 | As a reference, Ubuntu 22.04 (April 2022) comes with cmake 3.22.1, and 565 | PiOS 12 (November 2023) comes with cmake 3.25.1. 566 | 567 | If you have trouble upgrading CMake, then you can always try by 568 | installing version 1.5-r6 from 2022-11-09 that I know compiles with 569 | cmake 3.16.3. To do this, check out commit 570 | [#71396e8ff1](https://git.familie-radermacher.ch/linux/ptouch-print.git/commit/?id=71396e8ff1f92f70bf67584a9b65315229fedfb6) 571 | and build from that version, i.e. 572 | 573 | ```sh 574 | $ git clone https://git.familie-radermacher.ch/linux/ptouch-print.git 575 | $ git checkout 71396e8ff1 576 | $ cd ptouch-print 577 | $ ./build.sh 578 | ``` 579 | 580 | and continue to install following the instructions above. That will 581 | give you: 582 | 583 | ```r 584 | $ ptouch-print --version 585 | ptouch-print version v1.5-r6-g71396e8 by Dominic Radermacher 586 | ``` 587 | 588 | 589 | 590 | [PT-D450]: https://www.brother-usa.com/products/ptd450 591 | [ptouch-print]: https://git.familie-radermacher.ch/linux/ptouch-print.git 592 | [CMake]: https://cmake.org/ 593 | [installing cmake]: https://cmake.org/download/ 594 | [gettext]: https://www.gnu.org/software/gettext/ 595 | [LibGD]: https://libgd.github.io/ 596 | [libusb]: https://libusb.info/ 597 | [Lmod]: https://lmod.readthedocs.io/en/latest/ 598 | [modulefiles/ptouch-print/1.5.lua]: modulefiles/ptouch-print/1.5.lua 599 | [SUID flag]: https://en.wikipedia.org/wiki/Setuid 600 | [udev]: https://en.wikipedia.org/wiki/Udev 601 | --------------------------------------------------------------------------------