[Gdal-dev] ECW and gdal-1.3.1 problem ?

Frank Warmerdam warmerdam at pobox.com
Wed Dec 21 10:15:15 EST 2005


On 12/21/05, Ivan Mjartan <ivan.mjartan at geovap.cz> wrote:
>
> Hi list
> I tried to build gdal-1.3.1 library with ECW support.
> And I was not successful,
> At first I tried build gdal-1.3.1 with ECW SDK 2.46 but I was also not
> success.  So I download last version of  ECW SDK (3.3).
>
> Then start my C++ horror.
>
> I am not able compile ECW SDK with Visual Studio .Net 2003, a don't know
> why, I followed Build.txt, I downloaded latest Microsoft Platform SDK. And
> when I try build this library a get error
>
> midl : command line error MIDL1004 : cannot execute C preprocessor cl.exe

Ivan,

I haven't run into problems with midl before.

> in the build log is:
>
> NCSEcw : warning PRJ0041 : Cannot find missing dependency 'NCSEcw.tlb' for
> file 'NCSEcw.rc'.  Your project may still build, but may continue to appear
> out of date until this file is found.
> Creating temporary file
> "c:\Projects\Gdal\gdal130\ecw\libecwj2-3.3\Source\C\NCSEcw\NCSEcw\Release\RSP000001.rsp"
> with contents
> [
> /I "..\..\..\include" /I "c:\Program Files\Microsoft Visual Studio .NET
> 2003\Vc7\bin" /env win32 /Oicf  /tlb ".\NCSEcw.tlb" /h "NCSEcwCom.h" /iid
> "NCSEcw_i.c"
> ".\NCSEcw.idl"]Creating command line "midl.exe
> @"c:\Projects\Gdal\gdal130\ecw\libecwj2-3.3\Source\C\NCSEcw\NCSEcw\Release\RSP000001.rsp"
> /nologo"Creating Type Library...Processing .\NCSEcw.idlmidl : command line
> error MIDL1004 : cannot execute C preprocessor cl.exe
>
> What I am doing wrong?
> And another questions Is last ECW SDK and GDAL -1.3.1 compatible?
> Can I get somewhere ECW binary? (I tried new ones from emapper.com) but
> there was not some headers.

To the best of my knowledge ERMapper has not released binaries corresponding
to ECW SDK 3.3RC. GDAL 1.3.1 is ECW SDK 3.3 compatible though you will
need to adjust the build stuff for windows somewhat.

> Or have I wrong Microsoft Platform SDK installed (I tried this PSD-x86.exe
> from
> http://www.microsoft.com/msdownload/platformsdk/sdkupdate)
>
> Or If someone is successful in building last GDAL and Last ECW Could you
> tell me pleas step by step instruction how it is possible ?

I was recently successful in building the ECW SDK 3.3 with
Visual Studio 2002, but I had to convert the 2003 solution back
to do this.  With 2003 it should be more straight forward.

In the particular build, we used /MT instead of /MD for
compatability with the end application in question.  I doubt
this is necessary and in fact it likely complicates things.

For me, aftering installing the latest x86 platform SDK, the build
of the ECW SDK was problem free.   I don't know why you are
running into problems.

But for GDAL there were a number of changes required.  I had to
change the nmake.opt to link against the libecwj2.lib instead of
the old libraries.

eg.
ECWDIR  = 	C:\warmerda\libecwj2-3.3
ECWLIB  = 	$(ECWDIR)\Source\NCSBuildQmake\Debug\libecwj2.lib

And in gdal/frmts/ecw/makefile.vc I had to make changes to get all
the same defines as the ECW SDK is built with.  Otherwise you will
suffer "vtable hell".  The makefile now looks like:

EXTRAFLAGS = 	-I$(ECWDIR)\include -I$(ECWDIR)/Source/include \
		/D_MBCS /D_UNICODE /DUNICODE /D_WINDOWS \
		/DLIBECWJ2 /DWIN32 /D_WINDLL -DFRMT_ecw -DNO_X86_MMI

OBJ	=	ecwdataset.obj ecwcreatecopy.obj jp2userbox.obj

GDAL_ROOT	=	..\..

!INCLUDE $(GDAL_ROOT)\nmake.opt

default:	$(OBJ)
	copy *.obj ..\o

all:	default testecw.exe

clean:
	-del *.obj
	-del *.exe


Once these changes were in place, I didn't have any
more problems with the build.

I did recently changes the ecwcreatecopy.cpp code so that it
creates the GeoTIFF for GeoJP2 support myself.  The translation
through the ERMapper "GDT" coordinate system representation
wasn't working too well for me in some cases.

Based on that, I would encourage you to upgrade to the nightly
snapshot of GDAL.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list