Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#define exported in geo_config.h conflict with other packages such as GDAL #61

Closed
rouault opened this issue Dec 17, 2021 · 0 comments
Closed

Comments

@rouault
Copy link
Member

rouault commented Dec 17, 2021

[13:54] <runette> rouault[m] as discussed elsewhere - I have been trying to get the cmake build working on local Mac and Windows machines and I seem to have a few problems that I am trying to get past one by one. On Mac - using dependencies loaded from Conda (I don't have brew installed) the generate phase seems to work fine but I get this error messge when building
[13:54] <runette> :
[13:54] <runette> In file included from /Users/paulharwood/documents/GitHub/gdal/frmts/pds/vicardataset.cpp:44:
[13:54] <runette> In file included from /Users/paulharwood/opt/miniconda3/envs/gdal/include/geotiff.h:52:
[13:54] <runette> #define HAVE_STRING_H
[13:54] <runette>         ^
[13:54] <runette> #define HAVE_STRING_H 1
[13:54] <runette> Any ideas?
[13:54] <runette> That snippet should have been
[13:54] <runette> `In file included from /Users/paulharwood/documents/GitHub/gdal/frmts/pds/vicardataset.cpp:44:
[13:54] <runette> In file included from /Users/paulharwood/opt/miniconda3/envs/gdal/include/geotiff.h:52:
[13:55] <runette> #define HAVE_STRING_H
[13:55] <runette>         ^
[13:55] <runette> #define HAVE_STRING_H 1`
[13:56] <runette> "/Users/paulharwood/documents/GitHub/gdal-build/port/cpl_config.h:78:9: note: previous definition is here
[13:56] <runette> #define HAVE_STRING_H 1"
[13:58] <even> runette: it is just a warning, not an error ?
[14:02] <even> I presume the geo_config.h from your libgeotiff must come from a libgeotiff CMake build since it has just #define HAVE_STRING_H with a libgeotiff autoconf build, it is #define HAVE_STRING_H 1
[14:03] <even> it is annoying that we export such stuff from both GDAL and libgeotiff. That should be fixed in both ideally
[14:04] <runette> It is an error - Libera was swallowing the lien - it was "/Users/paulharwood/opt/miniconda3/envs/gdal/include/geo_config.h:8:9: error: 'HAVE_STRING_H' macro redefined [-Werror,-Wmacro-redefined]"
[14:04] <even> or have it prefixed with GDAL_ or LIBGEOTIFF_
[14:04] <even> yes, if you build with -Werror. Without it, that should build despite the warning
[14:05] <runette> I will try that - thanks
[14:05] <even> as a workaround, can you try manually to edit  /Users/paulharwood/opt/miniconda3/envs/gdal/include/geotiff.h to add a " 1" at the end of the offending #define 
rouault added a commit to rouault/libgeotiff that referenced this issue Dec 17, 2021
…_H (fixes OSGeo#61)

- Avoid collision with other packages such as GDAL
- No longer test basic C headers. If there are not there, the build
system is highly broken.
rouault added a commit that referenced this issue Dec 17, 2021
geo_config.h: prefix HAVE_xxx and restrict it to GEOTIFF_HAVE_STRINGS_H (fixes #61)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant