mapbox / windows-builds

DEPRECATED! build scripts for mapnik dependencies, mapnik, node-mapnik, node, libosmiom, osmium-tool
38 stars 22 forks source link

Error building gdal/odbccp32.lib #53

Closed springmeyer closed 9 years ago

springmeyer commented 9 years ago

@BergWerkGIS - working on tagging mapnik v3.0.1 and therefore kicked off a windows build of the Mapnik SDK. Seeing this error:

x64|||2015-07-28 02:20:42|||stdout|||   Creating library gdal_i.lib and object gdal_i.exp
x64|||2015-07-28 02:20:42|||stdout|||odbccp32.lib(dllload.obj) : error LNK2019: unresolved external symbol _vsnwprintf_s referenced in function StringCchPrintfW
x64|||2015-07-28 02:20:42|||stdout|||gdal200.dll : fatal error LNK1120: 1 unresolved externals
x64|||2015-07-28 02:20:43|||stderr|||NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\link.EXE"' : return code '0x460'

Is this perhaps happening because the legacy_stdio_definitions.lib is still needed when building with VS 2014? I'm open to just moving to 2015, but creating this nonetheless in case the fix is quick.

wilhelmberg commented 9 years ago

This error is expected with VS2014. As I've had good results with VS2015 till now, I've already switched the scripts to VS2015. But build server is not yet updated to VS2015. I can manually publish the SDK as soon as it is ready.

Reopen, if you want to stay with VS2014, which I don't recommend (See latest tickets for Mapbox Studio).

springmeyer commented 9 years ago

Reopen, if you want to stay with VS2014

Full steam ahead on 2015 sounds good.

rmkemker commented 9 years ago

I am having the same issue, but I am using VS2015. The error message was nearly identical. Was there ever a solution to this issue? Thank-you.

wilhelmberg commented 9 years ago

@rmkemker Not seeing any problems with gdal 2.0.0 or gdal 2.0.1 and VS2015. We use this script for building gdal.

rmkemker commented 9 years ago

I will give that a try. Thank-you!

wilhelmberg commented 9 years ago

@rmkemker A bit of information: If the error still occurs for you and you don't need ODBC support (e.g. MS SQL Server) you can either

rmkemker commented 9 years ago

@BergWerkGIS, I tried that and got the same error.

Creating library gdal_i.lib and object gdal_i.exp
odbccp32.lib(dllload.obj) : error LNK2019: unresolved external symbol _vsnwprintf_s referenced in function StringCchPrintfW
gdal201.dll : fatal error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\link.EXE"' : return code '0x460'
Stop. 
wilhelmberg commented 9 years ago

@rmkemker are you sure, you are on latest VS2015 RTM? For me, this error only appeared with VS2014/VS2015 CTPs and gdal <2.0.0 only.

These are the patches I used with different gdal versions and VS CTPs: https://github.com/mapbox/windows-builds/blob/master/patches/gdal-200-VS2015RC1.diff https://github.com/mapbox/windows-builds/blob/master/patches/gdal-VS2014CTP4.diff https://github.com/mapbox/windows-builds/blob/master/patches/gdal-VS2015RC1.diff

Otherwise I'm out of ideas and you might want to post to the official gdal mailing list: http://lists.osgeo.org/mailman/listinfo/gdal-dev

rouault commented 8 years ago

I just fought a bit to solve the same issue and I realize you've found the solution already... Anyway... Upstreamed as https://trac.osgeo.org/gdal/changeset/32019 / https://trac.osgeo.org/gdal/ticket/6255 . There's also now an appveyor target for VS2015 : https://ci.appveyor.com/project/rouault/gdal-coverage/build/1.0.1430/job/tjitd3pen0wenc9j

springmeyer commented 8 years ago

Thank you for the followup @rouault!