[SOLVED] Problem linking to ImageMagick-6.9.0-3-Q16-x86-dll on Windows 32-bit with mingw32
Posted: 2015-01-09T09:03:24-07:00
If I understand correctly, ImageMagick-6.9.0-3-Q16-x86-dll is built using msvc and I need to use gendef and dlltool to have a lib I can use with mingw32. I'm trying to link with a Go program using the canvas wrapper.
I'm able to link on 64-bit with ImageMagick-6.9.0-3-Q16-x64-dll.exe but on 32-bit with ImageMagick-6.9.0-3-Q16-x86-dll.exe I get :
Maybe I'm not using dlltool correctly. I saw ImageMagick-i686-pc-mingw32.tar.gz on the website but it's outdated (6.8.5) and there's no 64-bit version.
Code: Select all
cd C:\ImageMagick-6.9.0-Q16
gendef *.dll
mkdir C:\ImageMagick-6.9.0-Q16\lib
cd C:\ImageMagick-6.9.0-Q16\lib
dlltool -D ..\CORE_RL_magick_.dll -l libMagickCore.a -d ..\CORE_RL_magick_.def
dlltool -D ..\CORE_RL_wand_.dll -l libMagickWand.a -d ..\CORE_RL_wand_.def
Code: Select all
C:\DOCUME~1\test\LOCALS~1\Temp\go-build468732827\github.com\gosexy\canvas\_obj\canvas.cgo2.o:canvas.cgo2.c:(.text+0xeb0): undefined reference to `_imp__MagickRelinquishMemory'
C:\DOCUME~1\test\LOCALS~1\Temp\go-build468732827\github.com\gosexy\canvas\_obj\canvas.cgo2.o:canvas.cgo2.c:(.text+0x14bc): undefined reference to `_imp__MagickWandTerminus'
C:/mingw-w64/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bin/ld.exe: $WORK\github.com\gosexy\canvas\_obj\canvas.cgo2.o: bad reloc address 0x20 in section `.eh_frame'
C:/mingw-w64/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bin/ld.exe: final link failed: Invalid operation
collect2.exe: error: ld returned 1 exit status