[gdal-dev] Linking issue in Windows
Abel Pau
a.pau at creaf.cat
Mon Jun 2 07:46:45 PDT 2025
Daniel,
when I want to compile from windows using vcpkg I do:
cd d:\Github\gdal <-- whereever you have the gdal code
cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=C:/dev/vcpkg/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Debug
cmake --build build --config Debug
and make sure your environment variable PROJ_DATA is pointing to C:\dev\vcpkg\vcpkg\buildtrees\proj\x64-windows-dbg\data
(perhaps there are other things)
I hope it helps.
________________________________
De: gdal-dev <gdal-dev-bounces at lists.osgeo.org> de part de Andrew Bell via gdal-dev <gdal-dev at lists.osgeo.org>
Enviat el: dilluns, 2 de juny de 2025 16:01
Per a: Daniel Perez Rodriguez <dpr.1980 at gmail.com>
A/c: gdal-dev at lists.osgeo.org <gdal-dev at lists.osgeo.org>
Tema: Re: [gdal-dev] Linking issue in Windows
Hi Daniel,
Symbols that start with "__" are reserved for system libraries. It appears that you're not linking the C++ standard library or are linking with an incompatible version. GDAL requires C++17 support.
On Mon, Jun 2, 2025 at 5:25 AM Daniel Perez Rodriguez via gdal-dev <gdal-dev at lists.osgeo.org<mailto:gdal-dev at lists.osgeo.org>> wrote:
Good morning everyone.
My name is Daniel (first message here) from Spain so I hope I can explain my problem properly.
I am working in a C++ project, using gdal in Windows and getting it from vcpkg, using cmake and Visual Studio 2022.
From the last days, after an update of my development machine I am having a blocking issue compiling the project, to be a bit more precise: a linking issue. Here is my configuration and at the end I will put the errors:
DEVELOPMENT ENVIRONMENT:
Microsoft Visual Studio Professional 2022 Version 17.13.6
VisualStudio.17.Release/17.13.6+35931.197
Microsoft .NET Framework Version 4.8.09032
Installed Version: Professional
Microsoft Visual C++ 2022
ASP.NET<http://ASP.NET> and Web Tools 17.13.124.35287
Azure App Service Tools v3.0.0 17.13.124.35287
C# Tools 4.13.0-3.25167.3+73eff2b5de2ad38ec602c0a9e82f9125fb85992b
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
GitHub Copilot 17.13.444.19527
GitHub Copilot is an AI pair programmer that helps you write code faster and with less work.
Linux Core Dump Debugging 1.0.9.35825
Enables debugging of Linux core dumps.
Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines
NuGet Package Manager 6.13.2
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/
Qt Visual Studio Tools 3.3.1.1
This official Qt Group extension, Qt Visual Studio Tools, integrates Qt development tools into Microsoft Visual Studio 2022, enabling developers to use their familiar Windows environment without worrying about Qt-related build steps or tools.
SonarQube for Visual Studio 8.16.0.12791
SonarQube for Visual Studio is an extension to your favorite IDE that provides on-the-fly feedback to developers on new bugs and quality issues injected into their code.
TypeScript Tools 17.0.31211.2001
TypeScript Tools for Microsoft Visual Studio
Visual Basic Tools 4.13.0-3.25167.3+73eff2b5de2ad38ec602c0a9e82f9125fb85992b
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Visual C++ for Linux Development 1.0.9.35825
Visual C++ for Linux Development
Visual Studio IntelliCode 2.2
AI-assisted development for Visual Studio.
VCPKG.JSON (special attention please to gdal and proj entries)
{
"version": "0.0.0",
"builtin-baseline": "6f29f12e82a8293156836ad81cc9bf5af41fe836",
"dependencies": [
{"name": "boost-date-time", "version>=": "1.86.0"},
{"name": "boost-fiber", "version>=": "1.86.0"},
{"name": "boost-filesystem", "version>=": "1.86.0"},
{"name": "boost-geometry", "version>=": "1.86.0"},
{"name": "boost-headers", "version>=": "1.86.0"},
{"name": "boost-iostreams", "version>=": "1.86.0"},
{"name": "boost-property-tree", "version>=": "1.86.0"},
{"name": "boost-regex", "version>=": "1.86.0"},
{"name": "gdal", "version>=": "3.10.0", "default-features": false},
{"name": "gtest", "version>=": "1.15.2"},
{"name": "libgeotiff", "version>=": "1.7.3"},
{"name": "lodepng", "version>=": "2021-12-04"},
{"name": "nlohmann-json", "version>=": "3.11.3"},
{"name": "proj", "version>=": "9.5.1", "default-features": false},
{"name": "rapidxml", "version>=": "1.13#7"},
{"name": "shapelib", "version>=": "1.6.1"},
{"name": "sqlite3", "version>=": "3.48.0"},
{"name": "units", "version>=": "2.3.3"},
{"name": "zlib", "version>=": "1.3.1"}
]
}
ERROR OUTPUT:
44> Creating library C:/Users/*****/Release/project.lib and object C:/Users/*****/Release/project.exp
44>proj.lib(vgridshift.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>proj.lib(oputils.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>proj.lib(concatenatedoperation.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>proj.lib(coordinateoperationfactory.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>proj.lib(datum.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>proj.lib(crs.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>proj.lib(singleoperation.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>proj.lib(internal.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>proj.lib(io.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>proj.lib(factory.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(ogrdxf_leader.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>proj.lib(4D_api.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>proj.lib(c_api.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>proj.lib(grids.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(parsexsd.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(ogrpgdumplayer.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(ogrjsonfgwritelayer.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(ogrdxf_dimension.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(cbandinterleavedchannel.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(asciitiledir.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(binarytiledir.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(gmlreader.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(cpcidskblockfile.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(ogrwaspdatasource.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(ogrgmldatasource.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(ogrgeojsonutils.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(envidataset.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(cpl_vsil_abstract_archive.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(gdalargumentparser.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(gtiffsplitbitmapband.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(pdfcreatecopy.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(marfa_dataset.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(mrfdrivercore.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(zarr_v2_group.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(vrtderivedrasterband.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(pcidskcreate.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(pdsdrivercore.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(ogr_srs_erm.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(gdalpamproxydb.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(ogrcurvecollection.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(gdalsubdatasetinfo.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(gtiffdataset_read.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(cpl_vsi_mem.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(cpl_vsil_gzip.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(ogrgeometrycollection.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(ogrutils.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(mrf_util.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(deriveddataset.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(stacitdataset.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(snaptiffdriver.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(vicardataset.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(gribdataset.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(esric_dataset.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(safedataset.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(cplstring.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(ogrspatialreference.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(pdsdataset.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(pds4dataset.cpp.obj) : error LNK2001: unresolved external symbol __std_search_1
44>gdal.lib(marfa_dataset.cpp.obj) : error LNK2019: unresolved external symbol __std_find_last_of_trivial_pos_1 referenced in function "enum CPLErr __cdecl GDAL_MRF::Init_Raster(struct GDAL_MRF::ILImage &,class GDAL_MRF::MRFDataset *,struct CPLXMLNode *)" (?Init_Raster at GDAL_MRF@@YA?AW4CPLErr@@AEAUILImage at 1@PEAVMRFDataset at 1@PEAUCPLXMLNode@@@Z)
44>proj.lib(filemanager.cpp.obj) : error LNK2001: unresolved external symbol __std_find_last_of_trivial_pos_1
44>gdal.lib(ilwisdataset.cpp.obj) : error LNK2001: unresolved external symbol __std_find_last_of_trivial_pos_1
44>gdal.lib(grddataset.cpp.obj) : error LNK2001: unresolved external symbol __std_find_last_of_trivial_pos_1
44>gdal.lib(mrf_util.cpp.obj) : error LNK2001: unresolved external symbol __std_find_last_of_trivial_pos_1
44>gdal.lib(pcidskcreate.cpp.obj) : error LNK2001: unresolved external symbol __std_find_last_of_trivial_pos_1
44>gdal.lib(vrtderivedrasterband.cpp.obj) : error LNK2019: unresolved external symbol __std_find_end_1 referenced in function "char const * __cdecl std::_Find_end_vectorized<char const ,char const >(char const * const,char const * const,char const * const,unsigned __int64)" (??$_Find_end_vectorized@$$CBD$$CBD at std@@YAPEBDQEBD00_K at Z)
44>gdal.lib(gdal_mdreader.cpp.obj) : error LNK2001: unresolved external symbol __std_find_end_1
44>gdal.lib(ogrdxflayer.cpp.obj) : error LNK2001: unresolved external symbol __std_find_end_1
44>proj.lib(coordinateoperationfactory.cpp.obj) : error LNK2001: unresolved external symbol __std_find_end_1
44>gdal.lib(ogropenfilegdblayer_write.cpp.obj) : error LNK2019: unresolved external symbol __std_search_2 referenced in function "wchar_t const * __cdecl std::_Search_vectorized<wchar_t const ,wchar_t const >(wchar_t const * const,wchar_t const * const,wchar_t const * const,unsigned __int64)" (??$_Search_vectorized@$$CB_W$$CB_W at std@@YAPEB_WQEB_W00_K at Z)
44>gdal.lib(gnmgraph.cpp.obj) : error LNK2019: unresolved external symbol __std_remove_8 referenced in function "__int64 * __cdecl std::_Remove_vectorized<__int64,__int64>(__int64 * const,__int64 * const,__int64)" (??$_Remove_vectorized at _J_J@std@@YAPEA_JQEA_J0_J at Z)
44>C:/Users/*****/Release/project.exe : fatal error LNK1120: 5 unresolved externals
--
Libraries coming from VCPKG and the ones from the project are correctly built but the final linkage fails.
So any hint about where these "error LNK2001: unresolved external symbol __std_search_1" came from ?
Thanks in advance !
PS: sorry if this is not the correct channel to communicate these doubts and correct me in that case.
PPS: don't hesitate for any further information if you need it.
Daniel Pérez Rodríguez
daniteleco.github.io<http://daniteleco.github.io>
_______________________________________________
gdal-dev mailing list
gdal-dev at lists.osgeo.org<mailto:gdal-dev at lists.osgeo.org>
https://lists.osgeo.org/mailman/listinfo/gdal-dev
--
Andrew Bell
andrew.bell.ia at gmail.com<mailto:andrew.bell.ia at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20250602/f513333d/attachment-0001.htm>
More information about the gdal-dev
mailing list