[gdal-dev] GDAL/OGR 1.10.0 Beta1 Compiling with OpenJpeg 2.0

Even Rouault even.rouault at mines-paris.org
Fri Mar 1 19:44:18 PST 2013


Le samedi 02 mars 2013 00:56:34, allenck a écrit :
> I have had some problems compiling the 1.10 beta with OpenJpeg support on
> windows 7 and Microsoft Visual C++ 2008.
>  After configuring GDAL's nmake.opt file to include  OpenJpeg. I was
> getting errors that openjpeg-2.0\openjpeg.h could not be found. There is a
> workaround since GDAL is looking in the wrong place for the file:
>  a)in the OpenJpeg project, make a copy of directory 'openjp2' in folder
> ..\openjpeg\src\lib and rename it to openjpeg-2.0
>  a)Copy the file ..\Downloads\openjpeg\build\src\lib\openjp2\opj_config.h
> into the openjpeg-2.0 folder created above.
>  b)GDAL will now compile but you will get onresolved virtuals. In order to
> fix this, the gdal nmake.opt file needs to be edited to hard code the
> library path in the link command:
>  c)EXTERNAL_LIBS =	$(OGDILIB) $(XERCES_LIB) $(EXPAT_LIB) $(OCI_LIB)
> $(PG_LIB) \
> 	$(ECW_LIB_LINK) $(HDF4_LIB_LINK) $(FME_LIB) $(MRSID_LIB_LINK) \
> 	$(FITS_LIB_LINK) $(JPEG_LIB) $(NETCDF_LIB_LINK) $(PROJ4_LIB) \
> 	$(GEOTIFF_LIB) $(TIFF_LIB) $(PROJ_LIBRARY) $(SQLITE_LIB) \
> 	$(MYSQL_LIB) $(GEOS_LIB) $(HDF5_LIB_LINK) $(SDE_LIB) $(ARCOBJECTS_LIB)
> $(DWG_LIB) \
> 	$(IDB_LIB) $(CURL_LIB) $(DODS_LIB) $(KAKLIB) $(PCIDSK_LIB) \
> 	$(ODBCLIB) $(JASPER_LIB) $(PNG_LIB) $(ADD_LIBS) $(OPENJPEG_LIB) \
> 	$(MRSID_LIDAR_LIB) $(LIBKML_LIBS) $(SOSI_LIBS) $(POPPLER_LIBS) \
> 	C:\Users\Allen\Downloads\openjpeg\build\bin\Debug\openjp2.lib \
> 	C:\Users\Allen\Downloads\podofo-0.9.1\build\src\Debug\podofo.lib \
> 	"C:\Program Files (x86)\freetype\lib\freetype.lib" \
> 	gdi32.lib \
> 	$(LZMA_LIBS) \
> 	$(LIBICONV_LIBRARY) $(WEBP_LIBS) $(FGDB_LIB_LINK) $(FREEXL_LIBS)
> $(GTA_LIBS) \
> 	$(INGRES_LIB) $(LIBXML2_LIB) $(PCRE_LIB)

You shouldn't need to modify EXTERNAL_LIBS directly. You have to uncomment and 
adapt the following section of nmake.opt with the paths appropriate to your 
setup (or best copy it into nmake.local to avoid modifying nmake.opt itself)

# Uncomment for OpenJpeg (release v2.0.0) support
#OPENJPEG_ENABLED = YES
#OPENJPEG_CFLAGS = -IC:\openjpeg\include
#OPENJPEG_LIB = C:\openjpeg\lib\openjpeg.lib


More information about the gdal-dev mailing list