Page 1 of 1
"Undefined symbols" during linking demo code
Posted: 2008-08-29T06:08:00-07:00
by reimer
During the linking process I get an "undefined symbols" error message.
Code: Select all
g++ Demo.cpp -lMagick++
/usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld: Undefined symbols:
_CloneImageInfo
_DestroyExceptionInfo
_DestroyImageInfo
_GetExceptionInfo
_ReadImage
collect2: ld returned 1 exit status
Here is the demo code:
Code: Select all
#include <Magick++.h>
#include <list>
using namespace std;
using namespace Magick;
int main(int argc,char **argv)
{
list<Image> imageList;
readImages( &imageList, "test_image_anim.gif" );
Image appended;
appendImages( &appended, imageList.begin(), imageList.end() );
appended.write( "appended_image.miff" );
return 0;
}
What am I doing wrong?
Re: "Undefined symbols" during linking demo code
Posted: 2008-08-29T06:09:06-07:00
by magick
Add -lMagickWand -lMagickCore to your command line.
Re: "Undefined symbols" during linking demo code
Posted: 2008-08-29T06:41:38-07:00
by reimer
Thanks so far. MagickWand seems to not be installed. ImageMagick was installed by ports.
MagickWand can't be located. It should be installed with ImageMagick, shouldn't it?
Edit: both libraries cannot be found.
Re: "Undefined symbols" during linking demo code
Posted: 2008-08-29T06:57:24-07:00
by magick
The traditional way of compiling an example is this:
- g++ `Magick++-config --cflags --cppflags` -o magick++ magick++.cpp `Magick++-config --ldflags --libs`
Does that work for you?
MagickWand is generally installed whenever MagickCore is installed.
Re: "Undefined symbols" during linking demo code
Posted: 2008-08-29T07:33:32-07:00
by reimer
tiff cannot be located, but there are
/usr/local/lib/ImageMagick-6.3.3/modules-Q16/coders/tiff.la
/usr/local/lib/ImageMagick-6.3.3/modules-Q16/coders/tiff.so
Re: "Undefined symbols" during linking demo code
Posted: 2008-08-29T08:40:11-07:00
by magick
Type
- convert -debug configure,module logo: image.tif
It will tell you where it is looking to find the TIFF coder. Perhaps you have a permissions problem.
Re: "Undefined symbols" during linking demo code
Posted: 2008-09-01T08:37:09-07:00
by reimer
Here is what I get with "convert -debug configure,module logo: image.tif"
Warning: recursive semaphore lock detected!
2008-09-01T17:22:34+02:00 0:01 0.000u 6.3.3 Configure convert[993]: configure.c/unknown/482/Configure
Searching for configure file: "/usr/local/lib/ImageMagick-6.3.3/config/coder.xml"
Warning: recursive semaphore lock detected!
2008-09-01T17:22:34+02:00 0:01 0.010u 6.3.3 Configure convert[993]: configure.c/unknown/482/Configure
Searching for configure file: "/usr/local/share/ImageMagick-6.3.3/config/coder.xml"
Warning: recursive semaphore lock detected!
2008-09-01T17:22:34+02:00 0:01 0.010u 6.3.3 Configure convert[993]: configure.c/unknown/482/Configure
Searching for configure file: "/usr/local/share/doc/ImageMagick-6.3.3/coder.xml"
Warning: recursive semaphore lock detected!
2008-09-01T17:22:34+02:00 0:01 0.010u 6.3.3 Configure convert[993]: configure.c/unknown/482/Configure
Searching for configure file: "/usr/local/share/ImageMagick-6.3.3/coder.xml"
Warning: recursive semaphore lock detected!
2008-09-01T17:22:34+02:00 0:01 0.010u 6.3.3 Configure convert[993]: configure.c/unknown/482/Configure
Searching for configure file: "/Users/romain/.magick/coder.xml"
Warning: recursive semaphore lock detected!
2008-09-01T17:22:34+02:00 0:01 0.010u 6.3.3 Configure convert[993]: configure.c/unknown/482/Configure
Searching for configure file: "coder.xml"
Warning: recursive semaphore lock detected!
2008-09-01T17:22:34+02:00 0:01 0.010u 6.3.3 Configure convert[993]: coder.c/unknown/613/Configure
Loading coder map "/usr/local/share/ImageMagick-6.3.3/config/coder.xml" ...
Warning: recursive semaphore lock detected!
2008-09-01T17:22:34+02:00 0:01 0.020u 6.3.3 Module convert[993]: module.c/unknown/1065/Module
Searching for module "MAGICK" using filename "magick.la"
Warning: recursive semaphore lock detected!
2008-09-01T17:22:34+02:00 0:01 0.020u 6.3.3 Module convert[993]: module.c/unknown/582/Module
Searching for coder module file "magick.la" ...
Warning: recursive semaphore lock detected!
2008-09-01T17:22:34+02:00 0:01 0.020u 6.3.3 Module convert[993]: module.c/unknown/1085/Module
Opening module at path "/usr/local/lib/ImageMagick-6.3.3/modules-Q16/coders/magick.la"
Warning: recursive semaphore lock detected!
2008-09-01T17:22:34+02:00 0:01 0.020u 6.3.3 Module convert[993]: module.c/unknown/1120/Module
Method "RegisterMAGICKImage" in module "MAGICK" at address 0x7b1909
Warning: recursive semaphore lock detected!
...
2008-09-01T17:22:34+02:00 0:01 0.030u 6.3.3 Configure convert[993]: configure.c/unknown/482/Configure
Searching for configure file: "/usr/local/lib/ImageMagick-6.3.3/config/magic.xml"
Warning: recursive semaphore lock detected!
2008-09-01T17:22:34+02:00 0:01 0.030u 6.3.3 Configure convert[993]: configure.c/unknown/482/Configure
Searching for configure file: "/usr/local/share/ImageMagick-6.3.3/config/magic.xml"
Warning: recursive semaphore lock detected!
2008-09-01T17:22:34+02:00 0:01 0.030u 6.3.3 Configure convert[993]: configure.c/unknown/482/Configure
Searching for configure file: "/usr/local/share/doc/ImageMagick-6.3.3/magic.xml"
Warning: recursive semaphore lock detected!
2008-09-01T17:22:34+02:00 0:01 0.030u 6.3.3 Configure convert[993]: configure.c/unknown/482/Configure
Searching for configure file: "/usr/local/share/ImageMagick-6.3.3/magic.xml"
Warning: recursive semaphore lock detected!
2008-09-01T17:22:34+02:00 0:01 0.030u 6.3.3 Configure convert[993]: configure.c/unknown/482/Configure
Searching for configure file: "/Users/romain/.magick/magic.xml"
Warning: recursive semaphore lock detected!
2008-09-01T17:22:34+02:00 0:01 0.030u 6.3.3 Configure convert[993]: configure.c/unknown/482/Configure
Searching for configure file: "magic.xml"
Warning: recursive semaphore lock detected!
2008-09-01T17:22:34+02:00 0:01 0.030u 6.3.3 Configure convert[993]: magic.c/unknown/673/Configure
Loading magic map "/usr/local/share/ImageMagick-6.3.3/config/magic.xml" ...
Warning: recursive semaphore lock detected!
2008-09-01T17:22:34+02:00 0:01 0.070u 6.3.3 Module convert[993]: module.c/unknown/1065/Module
Searching for module "TIFF" using filename "tiff.la"
Warning: recursive semaphore lock detected!
2008-09-01T17:22:34+02:00 0:01 0.070u 6.3.3 Module convert[993]: module.c/unknown/582/Module
Searching for coder module file "tiff.la" ...
Warning: recursive semaphore lock detected!
2008-09-01T17:22:34+02:00 0:01 0.070u 6.3.3 Module convert[993]: module.c/unknown/1085/Module
Opening module at path "/usr/local/lib/ImageMagick-6.3.3/modules-Q16/coders/tiff.la"
Warning: recursive semaphore lock detected!
2008-09-01T17:22:34+02:00 0:01 0.070u 6.3.3 Module convert[993]: module.c/unknown/1120/Module
Method "RegisterTIFFImage" in module "TIFF" at address 0x15364f8
Warning: recursive semaphore lock detected!
2008-09-01T17:22:34+02:00 0:01 0.070u 6.3.3 Module convert[993]: module.c/unknown/1135/Module
Method "UnregisterTIFFImage" in module "TIFF" at address 0x15366f2
Warning: recursive semaphore lock detected!
Re: "Undefined symbols" during linking demo code
Posted: 2008-09-01T12:36:03-07:00
by magick
You should not be getting a recursive semaphore lock. If you have the time, try ImageMagick 6.4.3-5, the latest release.
The debugging information suggests the TIFF coder is found but that does not mean ImageMagick has built-in TIFF support. Type
Is TIFF associated with the DELEGATES tag? If not, rerun the configure script and verify that the TIFF delegate library is validated (check the last 40 or so lines of output). If not, review the config.log file and fix whatever problem it mentions as the reason why TIFF was not validated.