Skip to content

[gdal:x64-windows-static] missing geos dependencies #15526

@O-Tom

Description

@O-Tom

Host Environment

  • OS: Windows 10 build 1607
  • Compiler: Visual C++ 2017 00370-20001-21499-AA108 / VisualStudio.15.Release/15.9.29+28307.1300

To Reproduce
Steps to reproduce the behavior:

  • .\vcpkg install gdal --triplet=x64-windows-static
  • Write a basic program using gdal and compile/link with cmake.

Linking fails with missing symbols errors from the geos library.
Manually adding the geos package with cmake solves the linking errors (well... almost as it may generate conflicts with windows's io.h and ./include/geos/io.h but that's another story).

Looking at ./ports/gdal/dependency_win.cmake we see these declarations for geos

  # Setup geos libraries + include path
  set(GEOS_INCLUDE_DIR "${CURRENT_INSTALLED_DIR}/include" )
  set(GEOS_LIBRARY_REL "${CURRENT_INSTALLED_DIR}/lib/geos_c.lib" )
  set(GEOS_LIBRARY_DBG "${CURRENT_INSTALLED_DIR}/debug/lib/geos_cd.lib" )

But when geos is installed, it comes with two static libs, not one:
2021-01-08 16_10_05-lib

So I guess the geos declarations should be modified this way to be complete:

  # Setup geos libraries + include path
  set(GEOS_INCLUDE_DIR "${CURRENT_INSTALLED_DIR}/include" )
  set(GEOS_LIBRARY_REL "${CURRENT_INSTALLED_DIR}/lib/geos_c.lib ${CURRENT_INSTALLED_DIR}/lib/geos.lib" )
  set(GEOS_LIBRARY_DBG "${CURRENT_INSTALLED_DIR}/debug/lib/geos_cd.lib ${CURRENT_INSTALLED_DIR}/debug/lib/geosd.lib" )

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions