[gdal-dev] JPEG2000 decoding using OpenJpeg linking errors

Robert Zermeno refriguy68 at yahoo.com
Thu Apr 5 23:43:34 EDT 2012

Ladies and Gents,

I have downloaded the v2 branch of openjpeg from the svn yesterday while using CMAKE to construct VS2005 static library projects.  All went well to build the static library.  I linked the static library via modifying nmake.opt to point to the path location of the library (.lib) file and the include file (openjpeg.h).

I issue the command via VS2005 command prompt:

nmake /f makefile.vc debug=1

GDAL can compile successfully, but when it tries to create gdal_i.lib, I get LNK2019 errors for all references to openjpeg library (file openjpegdataset.obj).  The first two LNK2019 are in  IReadBlock  of 
opj_end_decompress at 8
opj_decode_tile_header at 40

What steps do I have to take to make it work?  Have I forgotten a step?  This is what I have in nmake.opt:

OPENJPEG_CFLAGS = -IC:\openjpeg\libopenjpeg
OPENJPEG_LIB = C:\openjpeg\bin\Release\openjpeg.lib
CFLAGS should point to openjpeg.h and LIB should point to the openjpeg.lib file.  It should work but I am puzzled?  Any advice?  Do I need to provide more information?  Has anyone experienced this problem?

FYI, I have performed a dumpbin.exe /SYMBOLS to verify the contents of the .lib file does have the requested functions to be used statically.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20120405/b0611605/attachment.html

More information about the gdal-dev mailing list