Dear all,

I am trying to compile a programme on Ubuntu 20.04 that links with libgdal.a. 
The compiler fails with this message:

/usr/bin/ld: /usr/lib/libgdal.a(ogrfeature.o): in function 
`OGRFeature::GetFieldAsSerializedJSon(int) const':
(.text+0x3861): undefined reference to `json_object_new_array'

If I understand it correctly, this means the json library is not being found. I 
thus made sure ld can actually find it:

$ ld -ljson --verbose
[...]
==================================================
ld: mode elf_x86_64
attempt to open /usr/local/lib/x86_64-linux-gnu/libjson.so failed
attempt to open /usr/local/lib/x86_64-linux-gnu/libjson.a failed
attempt to open /lib/x86_64-linux-gnu/libjson.so succeeded
/lib/x86_64-linux-gnu/libjson.so
[...]

I also added the -ljson flag but the compiler still fails. Is there something 
else missing beyond the json library?

Thank you.
--
Luís

Sent with [ProtonMail](https://protonmail.com) Secure Email.
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to