[gdal-dev] problems with compilation in vs2012

Darrel Maddy darrel.maddy at newcastle.ac.uk
Tue Aug 27 09:22:18 PDT 2013


OK I solved it.

I added ws2_32.lib to the libs in the linker. Sorry I should have been able to find this earlier, albeit I do not know why I suddenly have to start adding these – I guess something that VS2012 does differently.

Anyhow thanks for your help.

Darrel

From: gdal-dev-bounces at lists.osgeo.org [mailto:gdal-dev-bounces at lists.osgeo.org] On Behalf Of Darrel Maddy
Sent: 27 August 2013 17:10
To: Tamas Szekeres
Cc: gdal-dev at lists.osgeo.org
Subject: Re: [gdal-dev] problems with compilation in vs2012

Hi Tamas,

Thanks that helped ( although I have never had to add that before?) but I am still left with

1>  All outputs are up-to-date.
1>Link:
1>     Creating library E:\vs2012 projects\iwaveVS\x64\Release\iwaveVS.lib and object E:\vs2012 projects\iwaveVS\x64\Release\iwaveVS.exp
1>gdal.lib(gdalclientserver.obj) : error LNK2001: unresolved external symbol __imp_getaddrinfo
1>gdal.lib(gdalclientserver.obj) : error LNK2001: unresolved external symbol __imp_freeaddrinfo
1>E:\vs2012 projects\iwaveVS\x64\Release\iwaveVS.exe : fatal error LNK1120: 2 unresolved externals
1>

Any ideas?

Thanks again

Darrel



From: Tamas Szekeres [mailto:szekerest at gmail.com]
Sent: 27 August 2013 16:57
To: Darrel Maddy
Cc: gdal-dev at lists.osgeo.org<mailto:gdal-dev at lists.osgeo.org>
Subject: Re: [gdal-dev] problems with compilation in vs2012

Darrel,

Looks like the winsock library should also be included as an input for the linker of your app. (ie. wsock32.lib).

Best regards,

Tamas


2013/8/27 Darrel Maddy <darrel.maddy at newcastle.ac.uk<mailto:darrel.maddy at newcastle.ac.uk>>
Hi all,

I’m not entirely sure what I can do next.

We use gdal to input and output grids from our Landscape Evolution Model. Everything is working fine under linux but we are trying to develop cross-platform.

I downloaded the gdal-1.10.0 zip and altered the #win64 element of the options file and compiled using nmake –f makefile.vc<http://makefile.vc> MSCV_VER=1700 after running the vcvarsall.bat for amd64 . The library looks fine.

I have all the project properties setup to see the source directories (includes : default, plus gcore and port) and the linker is shown the way to the gdal.lib file.  Despite knowing where the library is I am getting the following linker errors

1>     Creating library E:\vs2012 projects\iwaveVS\x64\Release\iwaveVS.lib and object E:\vs2012 projects\iwaveVS\x64\Release\iwaveVS.exp
1>gdal.lib(gdalclientserver.obj) : error LNK2001: unresolved external symbol __imp_closesocket
1>gdal.lib(gdalclientserver.obj) : error LNK2001: unresolved external symbol __imp_connect
1>gdal.lib(gdalclientserver.obj) : error LNK2001: unresolved external symbol __imp_recv
1>gdal.lib(gdalclientserver.obj) : error LNK2001: unresolved external symbol __imp_send
1>gdal.lib(gdalclientserver.obj) : error LNK2001: unresolved external symbol __imp_socket
1>gdal.lib(gdalclientserver.obj) : error LNK2001: unresolved external symbol __imp_WSAStartup
1>gdal.lib(gdalclientserver.obj) : error LNK2001: unresolved external symbol __imp_WSACleanup
1>gdal.lib(gdalclientserver.obj) : error LNK2001: unresolved external symbol __imp_getaddrinfo
1>gdal.lib(gdalclientserver.obj) : error LNK2001: unresolved external symbol __imp_freeaddrinfo
1>E:\vs2012 projects\iwaveVS\x64\Release\iwaveVS.exe : fatal error LNK1120: 9 unresolved externals
1>
1>Build FAILED.

I have done this many times against earlier gdal libraries using VS2010 and not had this problem ( note I did however, in desperation compile against VER=1600 and set the toolset in VS2012 to 2010 but that had the same issue).

What am I missing?

Apologies if this is a stupid question.

Darrel


_______________________________________________
gdal-dev mailing list
gdal-dev at lists.osgeo.org<mailto:gdal-dev at lists.osgeo.org>
http://lists.osgeo.org/mailman/listinfo/gdal-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20130827/17334011/attachment-0001.html>


More information about the gdal-dev mailing list