Opened 9 years ago

Closed 9 years ago

#2468 closed defect (fixed)

GDAL JNI DLLs created without embedded manifest (MS VC 9.0)

Reported by: mnidel Owned by: aaime
Priority: normal Milestone: 1.7.0
Component: JavaBindings Version: 1.5.2
Severity: normal Keywords:
Cc:

Description

The DLLs built in GDAL under swig/java -- gdaljni.dll gdalconstjni.dll etc. -- have a separate manifest file but the manifest is not subsequently embedded in the DLLs. This causes an "R6034" error originating from MS Visual C CRT libraries (e.g. MSVCR90.dll).

The solution is to run "mt" (manifest tool) after linking the DLLs. This is already done for the main gdalxx.dll so it requires only a simple step to do the same for swig/java DLLs.

Modify the swig/java/makefile.vc to add the following line:

if exist XYZjni.dll.manifest mt -manifest XYZjni.dll.manifest -outputresource:XYZjni.dll;2

where "XYZjni.dll" is the actual name of the dll. This new line should go immediately after the following existing line:

link gdal_wrap.obj $(GDALLIB) /out:XYZjni.dll /DLL

This occurs 4 times in the file, so 4 modifications should guarantee that the manifests are built for ogrjni.dll, osrjni.dll, gdaljni.dll and gdalconstjni.dll.

The attachment contains a replacement makefile.vc with these 4 modifications, and a separate patch file to be applied to swig/java.

This problem occurs on Windows XP with MS Visual Studio 2008 (9.0), building against the GDAL 1.5 branch. This patch should be applied to the 1.5 branch before the next release if possible.

Attachments (2)

makefile.vc.patch (1006 bytes) - added by mnidel 9 years ago.
patch to fix this issue
makefile.vc (1.5 KB) - added by mnidel 9 years ago.
Replacement copy of makefile.vc containing fixes

Download all attachments as: .zip

Change History (3)

Changed 9 years ago by mnidel

Attachment: makefile.vc.patch added

patch to fix this issue

Changed 9 years ago by mnidel

Attachment: makefile.vc added

Replacement copy of makefile.vc containing fixes

comment:1 Changed 9 years ago by Even Rouault

Milestone: 1.7.0
Resolution: fixed
Status: newclosed

Applied in trunk in r16584

Note: See TracTickets for help on using tickets.