I was trying to upgrade from 6.6.1 to ImageMagick-6.7.6-0
CFLAGS=-g -O2 -Wall -fPIC
./configure --prefix=`pwd`/imagemagick-6.7.6-0 --disable-shared --with-quantum-depth=8 --disable-openmp
make -j 10
make install
It compiles ok. Then I encounter problem:
./Magick++-config --libs
Package Magick++ was not found in the pkg-config search path.
Perhaps you should add the directory containing `Magick++.pc'
to the PKG_CONFIG_PATH environment variable
No package 'Magick++' found
It is ok with my previous 6.6.1 version.
What should I do? Is this a bug?
Then I try to manually add g++ parameters:
-pthread -L$PWD_PATH/imagemagick-6.7.6-0/lib -lMagickCore -ltiff -lfreetype -ljpeg -lpng12 -lfontconfig -lXext -lXt -lSM -lICE -lX11 -lbz2 -lz -lm -lpthread -lMagick++ -lMagickWand
It reports "undefined symbol: MagickCoreTerminus" when running.
problem with pkg-config
Re: problem with pkg-config
Try setting the PKG_CONFIG_PATH to /usr/local/lib/pkgconfig.
Re: problem with pkg-config
Thank you, the pkg-config problem was solved after I add following to my build.sh:
PKG_CONFIG_PATH=`pwd`/libs/imagemagick-$IMK_VER/lib/pkgconfig
export PKG_CONFIG_PATH
It compiles ok now. But when I ran it, it reported:
undefined symbol: BZ2_bzDecompress
Then I tried to rebuild the imagemagick with --without-bzlib, then it reported:
undefined symbol: XConvertSelection
I am trying to build a apache_module.so that statically link with imagemagick. What should I do?
I found that someone said that I should recompile bzlib with -fPIC. This cann't be done, because I don't want to modify the system.
And I did not encounter this problem when I use v6.6.1. (v6.6.1 CAN statically link to apache_module.so, and runs well)
PKG_CONFIG_PATH=`pwd`/libs/imagemagick-$IMK_VER/lib/pkgconfig
export PKG_CONFIG_PATH
It compiles ok now. But when I ran it, it reported:
undefined symbol: BZ2_bzDecompress
Then I tried to rebuild the imagemagick with --without-bzlib, then it reported:
undefined symbol: XConvertSelection
I am trying to build a apache_module.so that statically link with imagemagick. What should I do?
I found that someone said that I should recompile bzlib with -fPIC. This cann't be done, because I don't want to modify the system.
And I did not encounter this problem when I use v6.6.1. (v6.6.1 CAN statically link to apache_module.so, and runs well)
Re: problem with pkg-config
XConvertSelection() is defined in the X11 delegate library. Add --without-x to your configure command line and rebuild ImageMagick. You might type 'make clean' before your build.
Re: problem with pkg-config
Thanks for your quick reply.magick wrote:XConvertSelection() is defined in the X11 delegate library. Add --without-x to your configure command line and rebuild ImageMagick. You might type 'make clean' before your build.
I recompile the imagemagick with "--without-bzlib --without-x", my module.so compiles ok. Now it reported running error:
undefined symbol: DrawPathStart
my gcc comand is:
g++ $CFLAGS --shared -o ./ap_module.so ./a.o ./b.o ./c.o -lml -ljson `$PWD_PATH/imagemagick-$IMK_VER/bin/Magick++-config --cppflags --cxxflags --ldflags --libs`
Then I added "-lMagickWand -lfreetype -lfontconfig" to my gcc command, and try argain, it reported:
undefined symbol: AnimateImages
Re: problem with pkg-config
AnimateImages() is defined in the X11 delegate library. You will need to remove the '--without-x' configure script option and perhaps add -lX11 to your linker command line.
Re: problem with pkg-config
I configured imagemagick with "--disable-shared --with-quantum-depth=8 --disable-openmp --without-bzlib"magick wrote:AnimateImages() is defined in the X11 delegate library. You will need to remove the '--without-x' configure script option and perhaps add -lX11 to your linker command line.
Set CFLAGS="-g -O2 -Wall -fPIC" before make imagemagick.
The result of "Magick++-config --cppflags --cxxflags --ldflags --libs" is:
-I/home/om/trunk/libs/imagemagick-6.7.6-0/include/ImageMagick
-I/home/om/trunk/libs/imagemagick-6.7.6-0/include/ImageMagick
-L/home/om/trunk/libs/imagemagick-6.7.6-0/lib -lMagick++ -lMagickCore
-L/home/om/trunk/libs/imagemagick-6.7.6-0/lib -lMagick++ -lMagickCore
I compiled my ap_module.so with:
g++ $CFLAGS --shared -o ./ap_module.so ./a.o ./b.o ./c.o -lml -ljson `$PWD_PATH/imagemagick-$IMK_VER/bin/Magick++-config --cppflags --cxxflags --ldflags --libs` -ltiff -lfreetype -ljpeg -lpng12 -lfontconfig -lXext -lXt -lSM -lICE -lX11 -lbz2 -lz -lm -lpthread -lMagickWand
It reported running error:
undefined symbol: AnimateImages
Re: problem with pkg-config
AnimateImages() is part of the X11 code within ImageMagick. Did you type 'make clean' before you rebuild ImageMagick? Try again. AnimateImages() is part of MagickCore if it is built with X11 support.
Re: problem with pkg-config
More than that, I "rm -rf" the whole directory, "tar xjvf ImageMagick-$IMK_VER.tar.bz2" again, before recompile.magick wrote:AnimateImages() is part of the X11 code within ImageMagick. Did you type 'make clean' before you rebuild ImageMagick? Try again. AnimateImages() is part of MagickCore if it is built with X11 support.
Can I directly add some xxx.o to my ap_module.so?