Recent

Author Topic: [solved] ImageMagick - generic link error  (Read 6995 times)

jacmoe

  • Full Member
  • ***
  • Posts: 249
    • Jacmoe's Cyber SoapBox
[solved] ImageMagick - generic link error
« on: February 10, 2017, 04:01:27 pm »
Whenever I try to use ImageMagick, I get a generic link error...

What do I need to do to use ImageMagick and magic_wand?

On Linux?

I have a complete ImageMagick installation.

Anyone using ImageMagick on Linux? Any tips?
« Last Edit: February 10, 2017, 04:48:31 pm by jacmoe »
more signal - less noise

Handoko

  • Hero Member
  • *****
  • Posts: 5153
  • My goal: build my own game engine using Lazarus
Re: ImageMagick - generic link error
« Reply #1 on: February 10, 2017, 04:10:05 pm »
Have you tried using the search feature on this forum?

I found a thread in this forum that maybe useful to you:
http://forum.lazarus.freepascal.org/index.php/topic,4503.msg21344.html#msg21344

jacmoe

  • Full Member
  • ***
  • Posts: 249
    • Jacmoe's Cyber SoapBox
Re: ImageMagick - generic link error
« Reply #2 on: February 10, 2017, 04:14:37 pm »
Have you tried using the search feature on this forum?
Many times!
But, apparently, you are better at searching.  :)
more signal - less noise

jacmoe

  • Full Member
  • ***
  • Posts: 249
    • Jacmoe's Cyber SoapBox
Re: ImageMagick - generic link error
« Reply #3 on: February 10, 2017, 04:17:16 pm »
No dice!

It is obvious to me that in order to use ImageMagick you need to install both runtime and development packages (imagemagick and imagemagick-dev).

It would be a lot easier to solve this issue if Lazarus would be more helpful instead of just spitting out a generic link error.  :-[
more signal - less noise

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 1228
Re: ImageMagick - generic link error
« Reply #4 on: February 10, 2017, 04:22:40 pm »
hello,

if you  speak french  have a look here

if you dont  ;D     :
what is your linux ? on ubuntu you must install imagemagick and libmagickwand-dev packages 
Friendly J.P
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

jacmoe

  • Full Member
  • ***
  • Posts: 249
    • Jacmoe's Cyber SoapBox
Re: ImageMagick - generic link error
« Reply #5 on: February 10, 2017, 04:25:37 pm »
I don't speak French, unfortunately, but here is what I have installed related to 'magick' :

more signal - less noise

jacmoe

  • Full Member
  • ***
  • Posts: 249
    • Jacmoe's Cyber SoapBox
Re: ImageMagick - generic link error
« Reply #6 on: February 10, 2017, 04:27:22 pm »
My Linux is Debian (testing) ..

Is it possible to teach Lazarus to give me more messages?
more signal - less noise

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 1228
Re: ImageMagick - generic link error
« Reply #7 on: February 10, 2017, 04:34:47 pm »
try to understand (or translate this) it seems there is a problem of link :
Michel_vbg :
Quote
Sous Debian 8.4 on trouve dans le répertoire /usr/lib/x86_64-linux-gnu/ les librairies libMagickWand-6.Q16.so.0.0 et libMagickCore-6.Q16.so.2.0.0, étant entendu que toutes les librairies nécessaires sont correctement installées.
Les liens symboliques présents, qui y font référence, se nomment respectivement libMagickWand-6.Q16.so et libMagickCore-6.Q16.so. Je suppose, pour avoir eu dans le passé de tels problèmes avec la librairie libmysql, que lazarus attends plutôt libMagickWand.so et libMagickCore.so
Il faut donc, dans le répertoire ci-dessus nommé, créer deux liens symboliques sur les librairies libMagickWand-6.Q16.so.0.0 et libMagickCore-6.Q16.so.2.0.0 que l'on nomme respectivement libMagickWand.so et libMagickCore.so et là le compilateur n'injurie plus personne. Je viens de tester, c'est positif maintenant!

Après vérification d'un Linux Mint 17.3( basé sur Ubuntu 14.04) dans une machine virtuelle ( je n'avais que ça sous la main) on trouve effectivement les liens symboliques "libMagickWand.so et libMagickCore.so" manquants sous Debian 8.4 par exemple.

C'est une difficulté récurrente dans Linux où les développeurs des distributions ont des conventions de nommages qui ne correspondent pas forcément à celles des développeurs d'autres applications. Je t'accorde que c'est un peu à l'arrache, mais qui veut la fin, doit vouloir aussi les moyens.
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

jacmoe

  • Full Member
  • ***
  • Posts: 249
    • Jacmoe's Cyber SoapBox
Re: ImageMagick - generic link error
« Reply #8 on: February 10, 2017, 04:36:22 pm »
Now, I went into the terminal and used 'lazbuild' instead to see if it gave me more messages to work with..

And, indeed, it did!  :D

Quote
/usr/bin/ld: cannot find -lMagickCore
[3.703] Executing "/usr/bin/ld" with command line "-b elf64-x86-64 -m elf_x86_64  --dynamic-linker=/lib64/ld-linux-x86-64.so.2    -L. -o Imaginary link.res"
[3.828] /home/jacmoe/projects/pascal/imaginary/Imaginary.lpr(43,1) Error: (9013) Error while linking
[3.828] /home/jacmoe/projects/pascal/imaginary/Imaginary.lpr(43,1) Fatal: (10026) There were 1 errors compiling module, stopping
[3.836] Fatal: (1018) Compilation aborted
Error: /home/jacmoe/fpcupdeluxe/fpc/bin/x86_64-linux/ppcx64 returned an error exitcode
Error: (lazarus) Compile Project, Mode: Debug, Target: Imaginary: stopped with exit code 256
ERROR: failed compiling of project /home/jacmoe/projects/pascal/imaginary/Imaginary.lpi

Since I already have lib magick core installed, perhaps I just need to make a symbolic link to resolve 'MagickCore' ?
more signal - less noise

jacmoe

  • Full Member
  • ***
  • Posts: 249
    • Jacmoe's Cyber SoapBox
Re: ImageMagick - generic link error
« Reply #9 on: February 10, 2017, 04:37:30 pm »
try to understand (or translate this) it seems there is a problem of link :
Yes, that's what I found out - thanks!

I will try and see if I can manage to make Lazarus happy with a symbolic link.
more signal - less noise

jacmoe

  • Full Member
  • ***
  • Posts: 249
    • Jacmoe's Cyber SoapBox
Re: ImageMagick - generic link error
« Reply #10 on: February 10, 2017, 04:40:08 pm »
So, what Michel is saying, is that libMagickWand-6.Q16.so.0.0 and libMagickCore-6.Q16.so.2.0.0 need to be symbolicly linked as libMagickWand.so and libMagickCore.so.

I will do that, and report back.
more signal - less noise

jacmoe

  • Full Member
  • ***
  • Posts: 249
    • Jacmoe's Cyber SoapBox
Re: [solved] ImageMagick - generic link error
« Reply #11 on: February 10, 2017, 04:50:25 pm »
Success! :D

What I had to do, in '/usr/lib/x86_64-linux-gnu':
Code: Pascal  [Select][+][-]
  1. sudo ln -s libMagickCore-6.Q16.so libMagickCore.so
  2. sudo ln -s libMagickWand-6.Q16.so libMagickWand.so

Thanks Jurassic Pork for pointing me in the right direction!
You saved my Lazarus project.
« Last Edit: February 10, 2017, 04:59:11 pm by jacmoe »
more signal - less noise

jacmoe

  • Full Member
  • ***
  • Posts: 249
    • Jacmoe's Cyber SoapBox
Re: [solved] ImageMagick - generic link error
« Reply #12 on: February 10, 2017, 04:53:42 pm »
Just want to mention again, that if you ever need to really see what Lazarus and FreePascal is doing, then close the IDE and use the lazbuild tool in the terminal.
more signal - less noise

 

TinyPortal © 2005-2018