0

I am trying to run the binary found at this site http://shaddack.brutowave.com/projects/sw_qr2laser/ I set it to executable and try and run ...

laptop@XPS15:~/Downloads$ qr2laser
qr2laser: command not found
laptop@XPS15:~/Downloads$

or ...

  laptop@XPS15:~/Downloads$ ./qr2laser
  ./qr2laser: error while loading shared libraries: libMagickWand.so.5: 
  cannot open shared object file: No such file or directory
  laptop@XPS15:~/Downloads$

It requires imagemagick to run and this is installed.

I have also tried to compile the source code but I also have errors relating to imagemagick.

Is this a reference error? Should imagemagick bein a different path?

  • That's some old software. 12.04 uses libmagickwand 6.6, 18.04 is likely to use 6.9, so for 5.0 you're out of luck. To compile, you need the libmagickwand-6-headers package, available in 16.04 and newer. – user535733 Nov 23 '17 at 03:37
  • I installed a VM on 12.04 and got a pretty much identical result. – Toy Teardown Nov 23 '17 at 04:09
  • Please try to compile the software from source as explained in my answer. If you encounter any warning or error messages please reproduce them in their entirety in your question ([edit]) using the formatting tools. In my opinion, using the precompiled binary should be the last resort. – dessert Nov 23 '17 at 07:40

2 Answers2

0

The only currently supported version of Ubuntu where libmagickwand5 is available is 14.04 (supported until April 2019), so installing it is one possible solution.

fkraiem
  • 12,555
  • 4
  • 35
  • 40
0

There are two ways here, you can either

  1. compile the software for your exact system from its source qr2laser.c or
  2. use the binary qr2laser as you tried.

The first one is what you should try first. Compiling on your system means the compiler will dig through your exact system to find the programs and libraries your software needs and create a binary. If there are missing dependencies, i.e. the compiler can't find programs your software needs, you will get a nice error message informing you what's wrong.
The second one has the downside that your system needs to have the same prerequisites as the system where the binary was compiled. In your case that's obviously not the case, and if you don't happen to use Ubuntu 14.04 it's hard (and not a good idea overall!) to install the missing libMagickWand.so.5 library.

Compile the software yourself (the way to go)

  1. Install the necessary compiler and your software's prerequisites:

    sudo apt install gcc libmagickwand-6.q16-2
    
  2. Download your software's source code:

    wget http://shaddack.brutowave.com/projects/sw_qr2laser/qr2laser.c
    
  3. Compile it:

    gcc -std=c99 -o qr2laser `pkg-config --cflags --libs MagickWand` qr2laser.c
    
  4. If everything went through without errors you will now have a qr2laser binary you can start:

    ./qr2laser
    

Use the precompiled binary (the last resort)

When it comes to old software a virtual machine is the way to go because you don't flood your working installation with hoary software.

  1. Install virtualbox:

    sudo apt install virtualbox
    sudo apt install virtualbox-ext-pack # optional, for e.g. USB 2.0 support 
    
  2. Set up a virtual machine and install a matching OS, Ubuntu 14.04 in this case.
  3. Inside the VM, install your software's prerequisites and run it:

    sudo apt install libmagickwand5
    /path/to/qr2laser
    
dessert
  • 39,982
  • I installed 14.04 in a VM. No matter what angle I attack this I get the following error ..

    qr2laser.c:(.text+0x1ead): undefined reference to MagickWandGenesis' qr2laser.c:(.text+0x1eb2): undefined reference toNewMagickWand' qr2laser.c:(.text+0x1ef1): undefined reference to MagickReadImage' qr2laser.c:(.text+0x1f2a): undefined reference toMagickGetException' qr2laser.c:(.text+0x1f6a): undefined reference to MagickRelinquishMemory' qr2laser.c:(.text+0x1f84): undefined reference toMagickGetImageWidth' qr2laser.c:(.text+0x1f96): undefined reference to `MagickGetImageHeight'

    – Toy Teardown Nov 24 '17 at 10:18
  • Yes, using the precompiled binary may be not a good idea at all, even in the VM you may not be able to recreate the system the binary was compiled for. Did you try compiling from source? – dessert Nov 24 '17 at 10:36
  • This was the result of compiling from source – Toy Teardown Nov 24 '17 at 18:43
  • Why did you compile in the VM? Use your normal system for that! – dessert Nov 24 '17 at 18:53
  • When I try and install the prerequisite on my system I get this error

    The following packages have unmet dependencies: libmagickwand-6.q16-2 : Depends: libmagickcore-6.q16-2 (>= 8:6.8.9.9) but it is not going to be installed PreDepends: dpkg (>= 1.17.6) E: Unable to correct problems, you have held broken packages.

    – Toy Teardown Nov 24 '17 at 19:26
  • @ToyTeardown You did try the solutions proposed in correspondent questions like Unable to correct problems, you have held broken packages, didn't you? – dessert Nov 24 '17 at 20:07