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

Error when building against proj 6.0.0 #277

Closed
nextstopsun opened this issue Mar 6, 2019 · 5 comments
Closed

Error when building against proj 6.0.0 #277

nextstopsun opened this issue Mar 6, 2019 · 5 comments

Comments

@nextstopsun
Copy link

I'm trying to build libosmium with latest proj library.
I'm getting a test error:

Scanning dependencies of target geom_test_factory_with_projection
[ 33%] Building CXX object test/CMakeFiles/thread_test_util.dir/t/thread/test_util.cpp.o
[ 33%] Building CXX object test/CMakeFiles/geom_test_factory_with_projection.dir/t/geom/test_factory_with_projection.cpp.o
[ 34%] Linking CXX executable util_test_misc
In file included from /usr/src/libosmium/include/osmium/geom/projection.hpp:50:0,
                 from /usr/src/libosmium/test/t/geom/test_factory_with_projection.cpp:4:
/usr/local/include/proj_api.h:37:2: error: #error 'To use the proj_api.h you must define the macro ACCEPT_USE_OF_DEPRECATED_PROJ_API_H'
 #error 'To use the proj_api.h you must define the macro ACCEPT_USE_OF_DEPRECATED_PROJ_API_H'

What needs to be done to build successfully?
Any special configure keys?

@nextstopsun
Copy link
Author

nextstopsun commented Mar 6, 2019

This is where this error comes from.
I guess other headers should be used instead.

@Nakaner
Copy link
Contributor

Nakaner commented Mar 6, 2019

Well, you use Proj 6 which has major changes to the API.

@joto
Copy link
Member

joto commented Mar 6, 2019

As @Nakaner said, there seems to be major changes in version 6. It seems we could just set ACCEPT_USE_OF_DEPRECATED_PROJ_API_H before doing the include, but I'd rather use the new API correctly from the beginning. If course this would need some #ifdefs or so, so that it still works with the old library version. If somebody wants to figure this out and send a pull request, that'd be great.

@cyper85
Copy link

cyper85 commented Jul 1, 2019

As @Nakaner said, there seems to be major changes in version 6. It seems we could just set ACCEPT_USE_OF_DEPRECATED_PROJ_API_H before doing the include, but I'd rather use the new API correctly from the beginning. If course this would need some #ifdefs or so, so that it still works with the old library version. If somebody wants to figure this out and send a pull request, that'd be great.

This isn't the solution. proj_api.h will be removed in proj v7. The macro is only a workaround for v6. The best solution is to disintegrate the old api.

joto added a commit that referenced this issue Aug 10, 2019
See #277. This is a stopgap solution until we find a better one. The
version 6 API is sufficiently different from the earlier API that
our code can't be made to work with the new API efficiently and
without changes. It will need some time to figure this out.
@joto
Copy link
Member

joto commented Aug 12, 2019

9fa0183 has a stopgap solution until we find a better one. The version 6 API is sufficiently different from the earlier API that our code can't be made to work with the new API efficiently and without changes. It will need some time to figure this out. Closing here.

@joto joto closed this as completed Aug 12, 2019
bob-beck pushed a commit to openbsd/ports that referenced this issue Mar 7, 2021
drops dependency on devel/proj, cf
osmcode/libosmium#277

add a patch to build with our zlib (needs gzclose_r/w, gzclose is
enough), hint from sthen@.

ok bentley@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants