From owner-freebsd-ports@FreeBSD.ORG Mon Jun 4 19:47:45 2012 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C942B106566C for ; Mon, 4 Jun 2012 19:47:45 +0000 (UTC) (envelope-from rhurlin@gwdg.de) Received: from fmailer.gwdg.de (fmailer.gwdg.de [134.76.11.16]) by mx1.freebsd.org (Postfix) with ESMTP id 569848FC15 for ; Mon, 4 Jun 2012 19:47:45 +0000 (UTC) Received: from p508c7dde.dip.t-dialin.net ([80.140.125.222] helo=krabat.raven.hur) by mailer.gwdg.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1SbdFe-0007BX-Nm; Mon, 04 Jun 2012 21:47:43 +0200 Message-ID: <4FCD10DE.5030509@gwdg.de> Date: Mon, 04 Jun 2012 21:47:42 +0200 From: Rainer Hurling User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:12.0) Gecko/20120602 Thunderbird/12.0.1 MIME-Version: 1.0 To: "O. Hartmann" References: <4FCD0DE2.8080607@zedat.fu-berlin.de> In-Reply-To: <4FCD0DE2.8080607@zedat.fu-berlin.de> Content-Type: multipart/mixed; boundary="------------020502040902050401040205" X-Authenticated: Id:rhurlin X-Spam-Level: - X-Virus-Scanned: (clean) by exiscan+sophie Cc: Ports FreeBSD Subject: Re: graphics/gdal: gifdataset.cpp:599:23: error: 'PrintGifError' was not declared in this scope X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 19:47:45 -0000 This is a multi-part message in MIME format. --------------020502040902050401040205 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 04.06.2012 21:34 (UTC+2), O. Hartmann wrote: > Since the last port update, I get this sticky error in gdal: > > libtool: compile: g++46 -O3 -pipe -fno-strict-aliasing -march=native > -Wl,-rpath=/usr/local/lib/gcc46 -Wall > -I/usr/ports/graphics/gdal/work/gdal-1.9.0/port > -I/usr/ports/graphics/gdal/work/gdal-1.9.0/gcore > -I/usr/ports/graphics/gdal/work/gdal-1.9.0/alg > -I/usr/ports/graphics/gdal/work/gdal-1.9.0/ogr > -I/usr/ports/graphics/gdal/work/gdal-1.9.0/ogr/ogrsf_frmts -DOGR_ENABLED > -I/usr/local/include -I/usr/ports/graphics/gdal/work/gdal-1.9.0/port > -I/usr/local/include -I/usr/local -I/usr/local/include > -I/usr/local/include -I/usr/local -I/usr/local/include -I/usr/local > -I/usr/local/include -I/usr/local/include -I/usr/local > -I/usr/local/include -I/usr/local -I/usr/local/include -I/usr > -I/usr/include -c gifdataset.cpp -fPIC -DPIC -o ../o/.libs/gifdataset.o > gifdataset.cpp: In static member function 'static GDALDataset* > GIFDataset::CreateCopy(const char*, GDALDataset*, int, char**, > GDALProgressFunc, void*)': > gifdataset.cpp:599:23: error: 'PrintGifError' was not declared in this scope > gifdataset.cpp:625:23: error: 'PrintGifError' was not declared in this scope I found a solution, presented in another thread some hours ago, see attachment. I am not filling a PR because gdal 1.9.1 seems to be in preparation ... Hope this helps, Rainer > gmake[2]: *** [../o/gifdataset.lo] Error 1 > gmake[2]: Leaving directory > `/usr/ports/graphics/gdal/work/gdal-1.9.0/frmts/gif' > gmake[1]: *** [gif-install-obj] Error 2 > gmake[1]: Leaving directory `/usr/ports/graphics/gdal/work/gdal-1.9.0/frmts' > gmake: *** [frmts-target] Error 2 > *** [do-build] Error code 1 > > Stop in /usr/ports/graphics/gdal. > *** [build] Error code 1 > > Stop in /usr/ports/graphics/gdal. > > ===>>> make failed for graphics/gdal > ===>>> Aborting update > > Terminated > > ===>>> You can restart from the point of failure with this command line: > portmaster graphics/gdal > > > Regards, > Oliver --------------020502040902050401040205 Content-Type: text/plain; charset=ISO-8859-15; name="patch-frmts__gif__gifdataset.cpp" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch-frmts__gif__gifdataset.cpp" --- frmts/gif/gifdataset.cpp.orig 2012-01-04 08:03:28.000000000 +0100 +++ frmts/gif/gifdataset.cpp 2012-06-04 17:21:24.000000000 +0200 @@ -470,6 +470,28 @@ } /************************************************************************/ +/* GDALPrintGifError() */ +/************************************************************************/ + +static void GDALPrintGifError(const char* pszMsg) +{ +/* GIFLIB_MAJOR is only defined in libgif >= 4.2.0 */ +/* libgif 4.2.0 has retired PrintGifError() and added GifErrorString() */ +#if defined(GIFLIB_MAJOR) && defined(GIFLIB_MINOR) && \ + ((GIFLIB_MAJOR == 4 && GIFLIB_MINOR >= 2) || GIFLIB_MAJOR > 4) + /* Static string actually, hence the const char* cast */ + const char* pszGIFLIBError = (const char*) GifErrorString(); + if (pszGIFLIBError == NULL) + pszGIFLIBError = "Unknown error"; + CPLError( CE_Failure, CPLE_AppDefined, + "%s. GIFLib Error : %s", pszMsg, pszGIFLIBError ); +#else + PrintGifError(); + CPLError( CE_Failure, CPLE_AppDefined, "%s", pszMsg ); +#endif +} + +/************************************************************************/ /* CreateCopy() */ /************************************************************************/ @@ -596,9 +618,7 @@ psGifCT->ColorCount, 255, psGifCT) == GIF_ERROR) { FreeMapObject(psGifCT); - PrintGifError(); - CPLError( CE_Failure, CPLE_AppDefined, - "Error writing gif file." ); + GDALPrintGifError("Error writing gif file."); EGifCloseFile(hGifFile); VSIFCloseL( fp ); return NULL; @@ -622,9 +642,7 @@ if (EGifPutImageDesc(hGifFile, 0, 0, nXSize, nYSize, bInterlace, NULL) == GIF_ERROR ) { - PrintGifError(); - CPLError( CE_Failure, CPLE_AppDefined, - "Error writing gif file." ); + GDALPrintGifError("Error writing gif file."); EGifCloseFile(hGifFile); VSIFCloseL( fp ); return NULL; --------------020502040902050401040205--