Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

Use gdal-config instead guessing the header/library locations #1782

Closed
openstreetmap-trac opened this issue Jul 23, 2021 · 3 comments
Closed

Comments

@openstreetmap-trac
Copy link

Reporter: bernd[at]bzed.de
[Submitted to the original trac issue database at 9.32am, Saturday, 2nd May 2009]

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.

http://git.debian.org/?p=collab-maint/merkaartor.git;a=blob;f=debian/patches/gdal-config

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

Cheers,

Bernd

@openstreetmap-trac
Copy link
Author

Author: achims311
[Added to the original trac issue at 7.26pm, Thursday, 7th May 2009]

Patch against 0.14-svn:
Index: src/src.pro

--- src/src.pro (Revision 14923)
+++ src/src.pro (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}

@openstreetmap-trac
Copy link
Author

Author: bernd[at]bzed.de
[Added to the original trac issue at 8.02pm, Thursday, 7th May 2009]

+               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
    yet).

@openstreetmap-trac
Copy link
Author

Author: koying
[Added to the original trac issue at 12.34pm, Thursday, 25th February 2010]

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant