rmagick-temp / rmagick

An interface to the ImageMagick and GraphicsMagick image processing libraries.
http://rmagick.rubyforge.org/
MIT License
790 stars 102 forks source link

Windows install fails: undefined reference to `GetExceptionInfo' etc #111

Closed jds13 closed 10 years ago

jds13 commented 10 years ago

I run

gem install rmagick -- --with-opt-include=c:\Tools\ImageMagick\include --with-opt-dir=c:\Tools\ImageMagick  --with-opt-lib=c:\Tools\ImageMagick\lib

and get successful compilations... but then the link step fails with lots of errors like

linking shared-object RMagick2.so
rmagick.o: In function `Magick_colors':
C:\Ruby\lib\ruby\gems\1.9.1\gems\rmagick-2.13.2\ext\RMagick/rmagick.c:40: undefined reference to `GetExceptionInfo'

My guess is that the ImageMagick .lib files aren't compatible with rmagick, or the native build process simply doesn't find the .lib files.

The --with-opt-lib and --with-opt-dir directives don't seem to have any effect - either the directives are ignored, or the libraries aren't in the right format, or don't contain the right export values.

Three days of trying... Identical results with ImageMagick 6778, 6803, and 6895. Ruby 1.9.3p545, gem 2.0.0 (with gem 2.4.1, "make clean" produced "Makefile:165: **\* target pattern contains no `%'. Stop."). DevKit 4.5.2. dumpbin \tools\imagemagick\lib\CORE_RL_magick_.lib /exports | grep GetExceptionInfo produces

                  _GetExceptionInfo
Does anyone have any suggestions at all? Thank you very much
jds13 commented 10 years ago

Maybe this will help someone some day.

I got past this by upgrading to Ruby 2.0.0p481 32-bit (current as of this note). Next I installed the 32-bit DevKit. I also installed ImageMagick 6.7.7-8 (though other versions might work) and placed it first in my PATH.

With that,

gem install rmagick --platform=ruby -- --with-opt-dir=c:\Tools\ImageMagick

ran fine and installed rmagick 2.13.2.