<div>Hi Even, thank you for the reply.<br></div><div><br></div><div>libjson-c-dev is already installed in the system, and the linker can find it:<br></div><div><br></div><div>$ ld -ljson-c --verbose<br></div><div>[...]<br></div><div>==================================================<br></div><div>ld: mode elf_x86_64<br></div><div>attempt to open /usr/local/lib/x86_64-linux-gnu/libjson-c.so failed<br></div><div>attempt to open /usr/local/lib/x86_64-linux-gnu/libjson-c.a failed<br></div><div>attempt to open /lib/x86_64-linux-gnu/libjson-c.so failed<br></div><div>attempt to open /lib/x86_64-linux-gnu/libjson-c.a failed<br></div><div>attempt to open /usr/lib/x86_64-linux-gnu/libjson-c.so succeeded<br></div><div>/usr/lib/x86_64-linux-gnu/libjson-c.so<br></div><div>[...]<br></div><div><br></div><div>But the compiler still fails in the same way, whether I include the -json-c flag or not. Below is the output with the full compiler command:<br></div><div><br></div><div>g++  -I../../lib/dglib/include -I../../lib/shapelib/include -I../../lib/proj4lib/include -I/usr/include/gdal -O3 -std=c++11 -ljson-c    -o dggrid binvals.o dggrid.o quadclip.o transform.o binpres.o gridgen.o DgHexSF.o param.o clipper.o table.o util.o ../../lib/dglib/lib/dglib.a ../../lib/shapelib/lib/shapelib.a ../../lib/proj4lib/lib/proj4lib.a /usr/lib/libgdal.a<br></div><div>/usr/bin/ld: /usr/lib/libgdal.a(shp_vsi.o): in function `SASetupDefaultHooks':<br></div><div>(.text+0x2d0): multiple definition of `SASetupDefaultHooks'; ../../lib/shapelib/lib/shapelib.a(safileio.o):safileio.c:(.text+0xc0): first defined here<br></div><div>/usr/bin/ld: /usr/lib/libgdal.a(ogrfeature.o): in function `OGRFeature::GetFieldAsSerializedJSon(int) const':<br></div><div>(.text+0x3861): undefined reference to `json_object_new_array'<br></div><div><br></div><div>Any other hints welcome. Thank you.<br></div><div class="protonmail_signature_block"><div class="protonmail_signature_block-user"><div><br></div><div>-- <br></div><div>Luís<br></div></div><div><br></div><div class="protonmail_signature_block-proton">Sent with <a href="https://protonmail.com" target="_blank">ProtonMail</a> Secure Email.<br></div></div><div><br></div><div>‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐<br></div><div> On Tuesday, July 21, 2020 11:02 PM, Even Rouault <even.rouault@spatialys.com> wrote:<br></div><div> <br></div><blockquote class="protonmail_quote" type="cite"><p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Luí­s,<br></p><p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> <br></p><p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">normally GDAL builds out-of-the-box regarding libjson-c on Ubuntu.<br></p><p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> <br></p><p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">You have 2 possibilities, install libjson-c-dev, or let GDAL use its internal copy of libjson-c.<br></p><p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> <br></p><p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">In your linking attempts, this should be rather -ljson-c than -ljson, but normally you shouldn't have to do that.<br></p><p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> <br></p><p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Even<br></p><p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> <br></p><p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">--<br></p><p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Spatialys - Geospatial professional services<br></p><p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">http://www.spatialys.com<br></p></blockquote><div><br></div>