Opened 11 years ago

Closed 10 years ago

#1782 closed defect (fixed)

Use gdal-config instead guessing the header/library locations

Reported by: bernd@… Owned by: cbro@…
Priority: major Milestone:
Component: merkaartor Version:
Keywords: Cc:


Hi developers,

depending on the distribution, the gdal libraries and headers are not necessarily in /usr/{include,lib}. You should use gdal-config to find the necessary linker and preprocessor flags.;a=blob;f=debian/patches/gdal-config

is what I'm using in Debian, not sure if there's a better way, though.



Change History (3)

comment:1 Changed 11 years ago by achims311

Patch against 0.14-svn: Index: src/ =================================================================== --- src/ (Revision 14923) +++ src/ (Arbeitskopie) @@ -185,8 +185,8 @@

win32-g++:LIBS += -lgdal

} unix {

  • INCLUDEPATH += /usr/include/gdal
  • LIBS += -lgdal

+ INCLUDEPATH += $$system(gdal-config --cflags) + LIBS += $$system(gdal-config --libs)


} world_shp.path = $${SHARE_DIR}

comment:2 Changed 11 years ago by bernd@…

+               INCLUDEPATH += $$system(gdal-config --cflags)

This doesn't sound like a good idea:

  • INCLUDEPATH is a list of paths, not of preprocessor options.
  • gdal-config --cflags may return more than -I flags (although it doesn't do it


comment:3 Changed 10 years ago by Chris Browet

Resolution: fixed
Status: newclosed

(In [20144]) FIX : Use gdal-config instead guessing the library locations (fixes #1782)

Note: See TracTickets for help on using tickets.