I'm attempting to import a kml/kmz file generated using Google Tracks into my QGIS 2.4 system (built with GDAL 1.10). KML files currently lose all attributes, and as such I'm attempting to build GDAL with libKML support as I'm led to believe this will solve this issue - as per https://code.google.com/p/libkml/wiki/BuildingAndInstalling on my Ubuntu 14.04 system.

I've successfully cloned and built the libkml library and tested it as per instructions in the wiki. I'm now trying to build gdal against the libKML library but keep failing.

I'm attempting to build against the latest SVN version as recommended here: http://www.gdal.org/drv_libkml.html

When running configure my system finds the Google KML headers but can't find the libkml library, even when I specify the path where where I built the library. For example on my system libKML was installed at /source/libkml/build

Has anyone had an experience building GDAL with this library on a linux system?

I can't seem to find any specific instructions for Ubuntu though some Fedora instructions have got me this far. As you can probably tell I'm not super confident using linux command line!

2 Answers 2


I clearly didn't use it at the moment but following the GDAL official Travis build configuration file should help you sort out the issue.

Just for info, this configuration file is for testing GDAL code on Ubuntu.

Trying on my computer only GDAL with kml integration, it works after below operations when testing with official example:

wget http://s3.amazonaws.com/etc-data.koordinates.com/gdal-travisci/install-libkml-r864-64bit.tar.gz
tar xzf install-libkml-r864-64bit.tar.gz
sudo cp -r install-libkml/include/* /usr/local/include
sudo cp -r install-libkml/lib/* /usr/local/lib
sudo ldconfig
wget http://download.osgeo.org/gdal/1.11.1/gdal-1.11.1.tar.gz
tar xvzf gdal-1.11.1.tar.gz
cd gdal-1.11.1
# Prefix is pointing to my empty directory to not mix with my other GDAL install
./configure --prefix=$HOME/gdal-compile --with-libkml
make install
export PATH=$HOME/gdal-compile/bin:$PATH
  • I'm having a problem compiling while following the steps provided in your answer. After spending a couple of days trying, I performed a fresh install of Ubuntu. It quits with the same error. This is the make output: Compile Errors. Can you advise me the possible culprit? Feb 21, 2017 at 17:07

I had the same problem, and then tried building gdal 1.11.1, that seemed to find the library nicely.

I'm not sure if it may be checking for version as well as path, or which version of GDAL starts working with libkml trunk as of 2014-11-09.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.