Undefined symbols when trying to use libgeos++-dev package in 22.04

Asked by Michael Downey

I am currently getting errors when trying to compile some example programs using libgeos++-dev in Ubuntu 22.04. I recently upgraded from 21.10 and everything was working ok.

Error occurs on the link and is something like:
undefined reference to `geos::geom::Coordinate::Coordinate(double, double, double)'

I believe this is an issue with the GEOS_INLINE define. Which normally would be set in the package build and if it isn't set when using the library you get this error. Setting GEOS_INLINE though causes compile time errors since all the .inl files are not included in the libgeos++-dev. Also it looks like upstream removed the use of GEOS_INLINE but it hasn't been released yet.

I was about to post this as a bug but maybe I'm missing something that others would know about? I can reproduce this error using the cpp_read.cpp example in the libgeos GitHub repo. I am using the following command line to compile:
g++ -o test -std=c++11 -lgeos -D USE_UNSTABLE_GEOS_CPP_API cpp_read.cpp

Any help would be appreciated, even if I should post this as a bug.

Thanks.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu geos Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

For diagnostic purposes please provide the output that you receive for the following commands:

uname -a
lsb_release -crid
apt policy libgeos++-dev libgeos-c1v5 libgeos-dev

Revision history for this message
Michael Downey (michael-downey) said :
#2

uname -a:
Linux michael-desktop 5.15.0-27-generic #28-Ubuntu SMP Thu Apr 14 04:55:28 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

lsb_release -crid:
Distributor ID: Ubuntu
Description: Ubuntu 22.04 LTS
Release: 22.04
Codename: jammy

apt policy:
libgeos++-dev:
  Installed: 3.10.2-1
  Candidate: 3.10.2-1
  Version table:
 *** 3.10.2-1 500
        500 http://ca.archive.ubuntu.com/ubuntu jammy/universe amd64 Packages
        100 /var/lib/dpkg/status
libgeos-c1v5:
  Installed: 3.10.2-1
  Candidate: 3.10.2-1
  Version table:
 *** 3.10.2-1 500
        500 http://ca.archive.ubuntu.com/ubuntu jammy/universe amd64 Packages
        100 /var/lib/dpkg/status
libgeos-dev:
  Installed: 3.10.2-1
  Candidate: 3.10.2-1
  Version table:
 *** 3.10.2-1 500
        500 http://ca.archive.ubuntu.com/ubuntu jammy/universe amd64 Packages
        100 /var/lib/dpkg/status

The problem is very likely that the libgeos++-dev package is missing all the .inl files. I downloaded the 3.10.2 release from libgeos' github and copied in all the .inl files and now I can get the example to correctly compile if I set the GEOS_INLINE define. There are issues in the geos github page specifically talking about the problems with GEOS_INLINE.

Revision history for this message
Manfred Hampl (m-hampl) said :
#3

As indicated by the version number (does not contain "ubuntu"), so it is the unmodified package from Debian.
If there is something wrong with the packages, then please create a bug report in the Debian.org tracker system.

Can you help with this problem?

Provide an answer of your own, or ask Michael Downey for more information if necessary.

To post a message you must log in.