Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

ImageMagick 'LIBRSVG_MAJOR_VERSION' undeclared #5478

Closed
mkoby opened this issue May 4, 2011 · 11 comments
Closed

ImageMagick 'LIBRSVG_MAJOR_VERSION' undeclared #5478

mkoby opened this issue May 4, 2011 · 11 comments

Comments

@mkoby
Copy link

mkoby commented May 4, 2011

Tried to install ImageMagick and got the following compile error (starting at the part that errors):

coders/svg.c:93:26: error: librsvg/rsvg.h: No such file or directory
coders/svg.c:97:38: error: librsvg/librsvg-features.h: No such file or directory
coders/svg.c:2678: error: expected declaration specifiers or '...' before 'gpointer'
coders/svg.c: In function 'SVGSetImageSize':
coders/svg.c:2683: error: 'context' undeclared (first use in this function)
coders/svg.c:2683: error: (Each undeclared identifier is reported only once
coders/svg.c:2683: error: for each function it appears in.)
coders/svg.c: In function 'ReadSVGImage':
coders/svg.c:2760: error: 'GdkPixbuf' undeclared (first use in this function)
coders/svg.c:2761: error: 'pixel_info' undeclared (first use in this function)
coders/svg.c:2764: error: nested functions are disabled, use -fnested-functions to re-enable
coders/svg.c:2764: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
coders/svg.c:2764: error: 'p' undeclared (first use in this function)
coders/svg.c:2768: error: 'GError' undeclared (first use in this function)
coders/svg.c:2769: error: 'error' undeclared (first use in this function)
coders/svg.c:2783: error: 'RsvgHandle' undeclared (first use in this function)
coders/svg.c:2784: error: 'svg_handle' undeclared (first use in this function)
coders/svg.c:2787: error: expected expression before ')' token
coders/svg.c:2788: error: too few arguments to function 'ThrowMagickException'
coders/svg.c:2796: error: expected expression before ')' token
coders/svg.c:2798: error: expected expression before ')' token
coders/svg.c:2801: error: expected expression before ')' token
coders/svg.c:2803: error: expected expression before ')' token
coders/svg.c: In function 'RegisterSVGImage':
coders/svg.c:3082: error: 'LIBRSVG_MAJOR_VERSION' undeclared (first use in this function)
coders/svg.c:3082: error: 'LIBRSVG_MINOR_VERSION' undeclared (first use in this function)
coders/svg.c:3082: error: 'LIBRSVG_MICRO_VERSION' undeclared (first use in this function)
make[1]: *** [coders/coders_svg_la-svg.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [install] Error 2
==> Exit Status: 2
http://github.com/mxcl/homebrew/blob/master/Library/Formula/imagemagick.rb#L86
==> Environment
HOMEBREW_VERSION: 0.8
HEAD: (none)
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_REPOSITORY: /usr/local
HOMEBREW_LIBRARY_PATH: /usr/local/Library/Homebrew
Hardware: 8-core 64-bit dunno
OS X: 10.6.7
Kernel Architecture: x86_64
Ruby: 1.8.7-174
/usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
Xcode: 3.2.3
GCC-4.0: build 5494 
GCC-4.2: build 5664 
LLVM: build 2326 
MacPorts or Fink? false
X11 installed? true
==> Build Flags
CC: /usr/bin/cc => /usr/bin/gcc-4.2
CXX: /usr/bin/c++ => /usr/bin/c++-4.2
LD: /usr/bin/cc => /usr/bin/gcc-4.2
CFLAGS:  -w -pipe -O3
CXXFLAGS:  -w -pipe -O3
CPPFLAGS: -I/usr/X11/include
LDFLAGS: -L/usr/X11/lib
MAKEFLAGS: -j8
@scrogson
Copy link

scrogson commented May 5, 2011

I'm getting the same issue.

@hynkle
Copy link
Contributor

hynkle commented Jun 4, 2011

Same. I uninstalled and reinstalled Homebrew, and am still getting the issue.

@ezravalmores
Copy link

Whats the solution for this error

@adamv
Copy link
Contributor

adamv commented Jun 7, 2011

brew update and then everyone gist your brew doctor. Thank you.

@stve
Copy link
Sponsor Contributor

stve commented Jun 28, 2011

I ran into the same issue. Did you previously have imagemagick installed with brew? I did and when I ran brew doctor, I got messages like this

ruby(1.9.2) blakey:/usr/local/lib [master]$ brew doctor
Unbrewed dylibs were found in /usr/local/lib.

If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected dylibs:
    /usr/local/lib/libcdt.4.dylib
    /usr/local/lib/libcgraph.5.dylib
    /usr/local/lib/libgraph.4.dylib
    /usr/local/lib/libgvc.5.dylib
    /usr/local/lib/libgvpr.1.dylib
    /usr/local/lib/libpathplan.4.dylib
    /usr/local/lib/libxdot.4.dylib

I removed all the files that brew doctor recommended I remove and then ImageMagick installed without a hitch.

@mkoby
Copy link
Author

mkoby commented Jun 28, 2011

My brew doctor output is below. I don't have any of the items spagalloco listed, and the "config" scripts in my path are from my binary installation of ImageMagick (because I needed for a project). Same with the DYLD_LIBARY_PATH, that's what the instructions for installing ImageMagick said to do (and my project breaks without that in my .bashrc).

Unbrewed dylibs were found in /usr/local/lib.

If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected dylibs:
    /usr/local/lib/libusb-1.0.0.dylib

Some "config" scripts were found in your path, but not in system or Homebrew folders.

`./configure` scripts often look for *-config scripts to determine if software packages
are installed, and what additional flags to use when compiling and linking.

Having additional scripts in your path can confuse software installed via Homebrew if
the config script overrides a system or Homebrew provided script of the same name.

/opt/ImageMagick-6.6.7/bin
    Magick++-config Magick-config MagickCore-config MagickWand-config Wand-config

Setting DYLD_LIBARY_PATH can break dynamic linking.
You should probably unset it.

/Library/Frameworks/Mono.framework detected

This can be picked up by Cmake's build system and likey cause the
build to fail, finding improper header files for libpng for instance.

@mkoby
Copy link
Author

mkoby commented Jun 28, 2011

I noticed that the "Library/Frameworks/Mono.framework error said "...likely cause the build to fail, finding improper header files for libpng for instance"

I wasn't having an issue with libpng but rather libsvg which is still a graphics library (and one I happen to know Mono makes use of) so on a whim I went ahead and uninstalled the Mono Framework (which I had installed via the Mono Installer pkg), and tried to brew install imagemagick again and it this time it worked.

The problem might have been Mono, but that just seems like a problem to me. Especially since I can't install Mono via homebrew and I use Mono somewhat regularly so not being able to have the two installed side-by-side without issues is worrisome.

While my particular issue is resolved, I think the fact that Mono causes an issue is still a problem and I wouldn't necessarily argue that this is a Mono issue either. Also, other people reporting the issue above may or may not have Mono installed so that should be something to check and as a result I'm going to leave this open for now.

@adamv
Copy link
Contributor

adamv commented Jun 28, 2011

If anyone can help us figure out what specifically Mono (.pkg) is doing to interfere, that would be great, and we can write a more specific brew doctor check.

@adamv
Copy link
Contributor

adamv commented Jun 28, 2011

Note that it may be the "fault" of the target software, looking for things in /Library/Frameworks ahead of other places. We've seen this with other Framework installs too.

@dtuite
Copy link

dtuite commented Jul 26, 2011

I had this same problem. Removing Mono using the method @mkoby suggested fixed the problem and allowed me to install imagemagick successfully. I don't know nearly enough about homebrew or mono to be able to help more but I thought I'd chime in with my own experience.

@adamv adamv closed this as completed Aug 12, 2011
@raldred
Copy link
Contributor

raldred commented Sep 12, 2011

Having this issue too.
uninstalling Mono is pretty drastic, I don't think this issue should be closed.

@Homebrew Homebrew locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants