multiple definition of `_zlibVersion'

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
Paul J

multiple definition of `_zlibVersion'

Post by Paul J »

Hi, I'm trying get ImageMagick 6.5.0.0 to compile with MinGW/MSYS (1.0.10). I built jpeg, tiff, and png (v1.2.35) libraries first. My configure output is below.

The ImageMagic make outputs...
libtool: link: warning: undefined symbols not allowed in i686-pc-mingw32 shared libraries
/bin/sh ./libtool --silent --tag=CC --mode=link gcc -std=gnu99 -g -O2 -Wall -W -o utilities/animate.exe utilities/animate.o magick/libMagickCore.la wand/libMagickWand.la
C:/msys/1.0/local/lib/libz.a(zutil.o):zutil.c:(.text+0x0): multiple definition of `_zlibVersion'
C:/msys/1.0/local/lib/libpng12.dll.a(d000411.o):(.text+0x0): first defined here
C:/msys/1.0/local/lib/libz.a(inflate.o):inflate.c:(.text+0x2c0): multiple definition of `_inflateInit_'
C:/msys/1.0/local/lib/libpng12.dll.a(d000034.o):(.text+0x0): first defined here
C:/msys/1.0/local/lib/libz.a(inflate.o):inflate.c:(.text+0x3f0): multiple definition of `_inflate'
C:/msys/1.0/local/lib/libpng12.dll.a(d000029.o):(.text+0x0): first defined here
C:/msys/1.0/local/lib/libz.a(inflate.o):inflate.c:(.text+0x1dc0): multiple definition of `_inflateEnd'
C:/msys/1.0/local/lib/libpng12.dll.a(d000031.o):(.text+0x0): first defined here
C:/msys/1.0/local/lib/libz.a(deflate.o):deflate.c:(.text+0x0): multiple definition of `_deflateEnd'
C:/msys/1.0/local/lib/libpng12.dll.a(d000018.o):(.text+0x0): first defined here
C:/msys/1.0/local/lib/libz.a(deflate.o):deflate.c:(.text+0x380): multiple definition of `_deflate'
C:/msys/1.0/local/lib/libpng12.dll.a(d000015.o):(.text+0x0): first defined here
C:/msys/1.0/local/lib/libz.a(deflate.o):deflate.c:(.text+0x18b0): multiple definition of `_deflateInit_'
C:/msys/1.0/local/lib/libpng12.dll.a(d000020.o):(.text+0x0): first defined here
collect2: ld returned 1 exit status
make[1]: *** [utilities/animate.exe] Error 1
make[1]: Leaving directory `/c/home/ImageMagick-MinGW/ImageMagick-6.5.0-0'
make: *** [all] Error 2

I found this post...
viewtopic.php?f=3&t=11088
and tried the solution for this, modifying the configure file for PNG as shown below...

/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char zlibVersion ();
int
main ()
{
return zlibVersion ();
;
/* return 0; per viewtopic.php?f=1&t=11419 */
return "1.2.3";
}

but it didn't help. Any ideas?
Thanks in advance..

Paul


================
== Config output ===
================
config.status: executing magick.sh.in commands

ImageMagick is configured as follows. Please verify that this configuration
matches your expectations.

Host system type: i686-pc-mingw32
Build system type: i686-pc-mingw32

Option Value
-------------------------------------------------------------------------------
Shared libraries --enable-shared=no no
Static libraries --enable-static=yes yes
Module support --with-modules=no no
GNU ld --with-gnu-ld=yes yes
Quantum depth --with-quantum-depth=16 16
High Dynamic Range Imagery
--enable-hdri=no no

Delegate Configuration:
BZLIB --with-bzlib=yes no
Autotrace --with-autotrace=no no
DJVU --with-djvu=yes no
DPS --with-dps=yes no
FlashPIX --with-fpx=yes no
FontConfig --with-fontconfig=no no
FreeType --with-freetype=yes no
GhostPCL None pcl6 (unknown)
GhostXPS None gxps (unknown)
Ghostscript None gswin32c (unknown)
Ghostscript fonts --with-gs-font-dir=default none
Ghostscript lib --with-gslib=no no
Graphviz --with-gvc=yes no
JBIG --with-jbig=yes no
JPEG v1 --with-jpeg=yes yes
JPEG-2000 --with-jp2=yes no
LCMS --with-lcms=yes no
LQR --with-lqr=yes no
Magick++ --with-magick-plus-plus=yes yes
OpenEXR --with-openexr=yes no
PERL --with-perl=no no
PNG --with-png=yes yes
RSVG --with-rsvg=no no
TIFF --with-tiff=yes yes
Windows fonts --with-windows-font-dir= none
WMF --with-wmf=no no
X11 --with-x= no
XML --with-xml=no no
ZLIB --with-zlib=yes yes

X11 Configuration:
X_CFLAGS =
X_PRE_LIBS =
X_LIBS =
X_EXTRA_LIBS =

Options used to compile and link:
PREFIX = /usr/local
EXEC-PREFIX = /usr/local
VERSION = 6.5.0
CC = gcc -std=gnu99
CFLAGS = -g -O2 -Wall -W
MAGICK_CFLAGS = -g -O2 -Wall -W
CPPFLAGS = -I/usr/local/include/ImageMagick -D_LIB -D_MT
PCFLAGS = -D_LIB -D_MT
DEFS = -DHAVE_CONFIG_H
LDFLAGS =
MAGICK_LDFLAGS = -L/usr/local/lib
LIBS = -lMagickCore -ltiff -ljpeg -lpng -lz -lgdi32 -lm
CXX = g++
CXXFLAGS = -g -O2 -Wall -W
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: multiple definition of `_zlibVersion'

Post by magick »

We compiled ImageMagick 6.5.1-6 just yesterday without complaint under Ming / MSYS. Not sure while its failing for you.
Paul J

Re: multiple definition of `_zlibVersion'

Post by Paul J »

We compiled ImageMagick 6.5.1-6 just yesterday without complaint under Ming / MSYS. Not sure while its failing for you.
I was wondering, do you included png (http://www.libpng.org/pub/png/libpng.html, v1.2.35) code? It seems to be having a problem with it.

Paul
Post Reply