-
Notifications
You must be signed in to change notification settings - Fork 790
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
Unable to build with c++17 #959
Comments
Try master branch, c++17 should work thanks for the link, I’ll keep in mind when I will try qt6 |
No it won't. Your vendored flann is outdated and still uses std::binary_function and random_schuffle. rtabmap/corelib/src/rtflann/util/heap.h Line 118 in ff61266
rtabmap/corelib/src/rtflann/util/random.h Line 120 in ff61266
just to point out two occurrences in the code. |
You are right, for some reason I thought I already built it on c++17, but it was c++14 Lines 746 to 755 in ff61266
I'll check to update flann, hopefully it won't break older machine configurations. |
Well, on ubuntu 20.04, setting explicitly to c++17 doesn't cause any building issues:
I'll try with in a docker 22.04 + Qt6... |
If it compiles with the stuff mentioned in #959 (comment) and c++17 then your c++ library is non conforming. But you probably want to check the build logs instead of the configure log if c++17 is really applied and cmake didn't add c++14 add the end. |
I've been updating to Qt6 on this pull request #968 with latest VTK/PCL and OpenCV, using c++17, and I still don't see the errors (this is a docker on Ubuntu 22.04)...
Maybe it is related to compiler on windows? I'll continue to keep on eye on this, and fix it when I will get the error. |
@Neumann-A I integrated your changes on latest master. The new 0.21.0 version is also now using cmake targets. I tried vcpkg build and cleanup the patches to build everything. See my pull request here: microsoft/vcpkg#30254. If you can comment on it it would appreciated. With VCPKG, the only issue I have right know is that Qt6 plugins are not copied in I tried microsoft/vcpkg#20101 (comment) in rtabmap's port file but I got cmake error during the build. I don't know where to put this. |
Have you tried to use https://www.qt.io/blog/cmake-deployment-api for deployment? Another solution might be to just copy the |
Thank you for the reviewing the PR, I am currently making the changes. For qt deployment, I missed that webpage, I tried the first time this, but saw after testing it was only for Qt 6.5, while vcpkg uses Qt 6.4. Then I tried this, which ultimately worked in my bundle build 46edd15, but it didn't work when I used the same cmake code in the |
Closing as it now works with C++17. |
@matlabbe: What Dockerfile did you use to test this? |
@mattiasmar To test latest dependencies, see this docker file: https://github.com/introlab/rtabmap/blob/master/docker/latest_deps/Dockerfile. Note that this docker file is not built in CI (would be too long) and as it is using always latest dependencies, it may fail at some point if dependencies have regressions (if so, open another issue). To build it:
|
rtabmap seems to use a bunch of deprecated functions blocking the build using Qt6
D:\buildtrees\rtabmap\src\v0.20.16-df5c73836d.clean\corelib\src\rtflann/util/heap.h(118): error C2039: 'binary_function': is not a member of 'std'
D:\buildtrees\rtabmap\src\v0.20.16-df5c73836d.clean\corelib\src\rtflann/util/random.h(120): error C2039: 'random_shuffle': is not a member of 'std'
D:\buildtrees\rtabmap\src\v0.20.16-df5c73836d.clean\corelib\src\rtflann/algorithms/dist.h(522): error C2065: 'pop_t': undeclared identifier
see : https://github.com/microsoft/vcpkg/pull/29078/files#diff-fef086b12acd48845cf68584a877b222d095bee60876c0b98c6a04768e8a8b9f
The text was updated successfully, but these errors were encountered: