[gdal-dev] GDAL Linking issues VS2015 64-bit

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[gdal-dev] GDAL Linking issues VS2015 64-bit

Candy, Liam

Hi all,

 

I managed to get the GDAL library with ECW support to compile and link for 32-bit, but realized I need to get the 64-bit library working. I’m having linking issues with this.

 

I’m running Windows 10, VS2015 command line tools, and trying to build GDAL 2.1.3 with support for ERDAS ECW 5.3. The relevant (I believe) parts of my nmake.opt file are;

 

WIN64=YES

 

# Uncomment the following and update to enable ECW read support with the 
# 4.1+ readonly SDK
ECWDIR  =  …\Hexagon\ERDAS_ECW_JPEG_2000_SDK_53
ECWFLAGS = -DECWSDK_VERSION=53 \
       -I$(ECWDIR)\include \
       -I$(ECWDIR)\include/NCSECW/api -I$(ECWDIR)\include/NCSECW/jp2 \
       -I$(ECWDIR)\include/NCSECW/ecw
ECWLIB  =  $(ECWDIR)\lib\vc110\x64\NCSEcw.lib

 

SYM_PREFIX=

 

(I’ve tried SYM_PREFIX=_) as well.
 
 

The output I get is;

 

Generating Code...

        cd ..

        if exist gdal.lib del gdal.lib

        lib /nologo /out:gdal.lib port\*.obj gcore\*.obj alg\*.obj frmts\o\*.obj ogr\ogrsf_frmts\ogrsf_frmts.lib ogr\ogr.lib gnm\*.obj gnm\gnm_frmts\o\*.obj   apps\commonutils.obj apps\gdalinfo_lib.obj apps\gdal_translate_lib.obj apps\gdalwarp_lib.obj apps\ogr2ogr_lib.obj  apps\gdaldem_lib.obj apps\nearblack_lib.obj apps\gdal_grid_lib.obj apps\gdal_rasterize_lib.obj apps\gdalbuildvrt_lib.obj

ogrsf_frmts.lib(ogrjmllayer.obj) : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library

ogr.lib(ograpispy.obj) : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library

nitf_gcprpc.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library

ecwcreatecopy.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library

cpl_recode_iconv.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library

        link /nologo /dll /INCLUDE:OSRValidate  /INCLUDE:OPTGetProjectionMethods  /INCLUDE:OGR_G_GetPointCount  /INCLUDE:OGRRegisterAll /INCLUDE:GDALSimpleImageWarp  /INCLUDE:GDALReprojectImage  /INCLUDE:GDALComputeMedianCutPCT  /INCLUDE:GDALDitherRGB2PCT  /INCLUDE:OCTNewCoordinateTransformation port\*.obj gcore\*.obj alg\*.obj frmts\o\*.obj ogr\ogrsf_frmts\ogrsf_frmts.lib ogr\ogr.lib gnm\*.obj gnm\gnm_frmts\o\*.obj   apps\commonutils.obj apps\gdalinfo_lib.obj apps\gdal_translate_lib.obj apps\gdalwarp_lib.obj apps\ogr2ogr_lib.obj  apps\gdaldem_lib.obj apps\nearblack_lib.obj apps\gdal_grid_lib.obj apps\gdal_rasterize_lib.obj apps\gdalbuildvrt_lib.obj        D:\Users\LCandy\AppData\Local\Hexagon\ERDAS_ECW_JPEG_2000_SDK_53\lib\vc110\x64\NCSEcw.lib                                                    gcore\Version.res  /out:gdal201.dll /implib:gdal_i.lib

   Creating library gdal_i.lib and object gdal_i.exp

LINK : error LNK2001: unresolved external symbol OSRValidate

LINK : error LNK2001: unresolved external symbol OPTGetProjectionMethods

LINK : error LNK2001: unresolved external symbol OGR_G_GetPointCount

LINK : error LNK2001: unresolved external symbol OGRRegisterAll

LINK : error LNK2001: unresolved external symbol GDALSimpleImageWarp

LINK : error LNK2001: unresolved external symbol GDALReprojectImage

LINK : error LNK2001: unresolved external symbol GDALComputeMedianCutPCT

LINK : error LNK2001: unresolved external symbol GDALDitherRGB2PCT

LINK : error LNK2001: unresolved external symbol OCTNewCoordinateTransformation

 

Followed by a string of ‘unresolved external symbol’ errors.

 

And, to confirm that I’m using the 64-bit compiler / linker from VS, the final line of the output is:

 

gdal201.dll : fatal error LNK1120: 247 unresolved externals

NMAKE : fatal error U1077: '"D:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64_x86\link.EXE"' : return code '0x460'

Stop.

 

I’ve been struggling with this for two days, so any help at all would be greatly appreciated.

 

Best regards,

Liam.

 

Liam Candy D +27 11 638 2078 M +27 11 282 8658 Ext 8113 2078

 

 

 


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: GDAL Linking issues VS2015 64-bit

Even Rouault-2

Liam,

 

>

> SYM_PREFIX=

--> You don't need to touch that one. Correct behaviour is determined by WIN64 setting

>

 

> LINK : error LNK2001: unresolved external symbol OSRValidate

> LINK : error LNK2001: unresolved external symbol OPTGetProjectionMethods

> LINK : error LNK2001: unresolved external symbol OGR_G_GetPointCount

> LINK : error LNK2001: unresolved external symbol OGRRegisterAll

> LINK : error LNK2001: unresolved external symbol GDALSimpleImageWarp

> LINK : error LNK2001: unresolved external symbol GDALReprojectImage

> LINK : error LNK2001: unresolved external symbol GDALComputeMedianCutPCT

> LINK : error LNK2001: unresolved external symbol GDALDitherRGB2PCT

> LINK : error LNK2001: unresolved external symbol

> OCTNewCoordinateTransformation

 

Did you issue a "nmake /f makefile.vc clean" before rebuilding ? (in case you compiled the tree initially with the 32 bit compiler, which is the only error cause I can think of given the other elements you mentionned)

 

Even

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: GDAL Linking issues VS2015 64-bit

Damian Dixon
We also do the following:

FOR /R gdal %%F IN (*.res) DO DEL /F /S "%%F" > nul
FOR /R gdal %%F IN (*.obj) DO DEL /F /S "%%F" > nul
FOR /R gdal %%F IN (*.pdb) DO DEL /F /S "%%F" > nul
FOR /R gdal %%F IN (*.dll) DO DEL /F /S "%%F" > nul
FOR /R gdal %%F IN (*.lib) DO DEL /F /S "%%F" > nul
FOR /R gdal %%F IN (*.exp) DO DEL /F /S "%%F" > nul

Where gdal is the directory containing the gdal 'source code'/build.



On 11 May 2017 at 15:41, Even Rouault <[hidden email]> wrote:

Liam,

 

>

> SYM_PREFIX=

--> You don't need to touch that one. Correct behaviour is determined by WIN64 setting

>

 

> LINK : error LNK2001: unresolved external symbol OSRValidate

> LINK : error LNK2001: unresolved external symbol OPTGetProjectionMethods

> LINK : error LNK2001: unresolved external symbol OGR_G_GetPointCount

> LINK : error LNK2001: unresolved external symbol OGRRegisterAll

> LINK : error LNK2001: unresolved external symbol GDALSimpleImageWarp

> LINK : error LNK2001: unresolved external symbol GDALReprojectImage

> LINK : error LNK2001: unresolved external symbol GDALComputeMedianCutPCT

> LINK : error LNK2001: unresolved external symbol GDALDitherRGB2PCT

> LINK : error LNK2001: unresolved external symbol

> OCTNewCoordinateTransformation

 

Did you issue a "nmake /f makefile.vc clean" before rebuilding ? (in case you compiled the tree initially with the 32 bit compiler, which is the only error cause I can think of given the other elements you mentionned)

 

Even

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev