koide3 / interactive_slam

Interactive Map Correction for 3D Graph SLAM
GNU General Public License v3.0
839 stars 258 forks source link

portable-file-dialogs.h and eigen errors while compiling #10

Open rrkmiao opened 4 years ago

rrkmiao commented 4 years ago

In member function ‘std::cxx11::string pfd::internal::dialog::buttons_to_name(pfd::choice) const’: /home/XXX/catkin_ws/src/interactive_slam/thirdparty/portable-file-dialogs/portable-file-dialogs.h:493:18: error: ‘choice’ is not a class, namespace, or enumeration case choice::ok_cancel: return "okcancel"; ^ /home/XXX/catkin_ws/src/interactive_slam/thirdparty/portable-file-dialogs/portable-file-dialogs.h:494:18: error: ‘choice’ is not a class, namespace, or enumeration case choice::yes_no: return "yesno"; In member function ‘std::cxx11::string pfd::internal::dialog::get_icon_name(pfd::icon) const’: /home/XXX/catkin_ws/src/interactive_slam/thirdparty/portable-file-dialogs/portable-file-dialogs.h:506:18: error: ‘icon’ is not a class, namespace, or enumeration case icon::warning: return "warning"; ^ /home/XXX/catkin_ws/src/interactive_slam/thirdparty/portable-file-dialogs/portable-file-dialogs.h:507:18: error: ‘icon’ is not a class, namespace, or enumeration case icon::error: return "error";

/home/XXX/catkin_ws/src/interactive_slam/src/hdl_graph_slam/plane_alignment_modal.cpp:93:67: required from here /usr/include/eigen3/Eigen/src/Core/DenseBase.h:41:34: error: invalid use of incomplete type ‘struct Eigen::internal::traits’ template class DenseBase

/home/XXX/catkin_ws/src/interactive_slam/src/hdl_graph_slam/plane_alignment_modal.cpp:1: /usr/include/eigen3/Eigen/src/Core/DenseBase.h:57:61: error: invalid use of incomplete type ‘struct Eigen::internal::traits’ typedef typename internal::traits::StorageKind StorageKind;

/home/XXX/catkin_ws/src/interactive_slam/src/hdl_graph_slam/plane_alignment_modal.cpp:1: /usr/include/eigen3/Eigen/src/Core/DenseBase.h:75:46: error: invalid use of incomplete type ‘struct Eigen::internal::traits’ typedef typename NumTraits::Real RealScalar;

and so on, all about "portable-file-dialogs.h" and eigen3 Working on ubuntu 16.04. Thanks for sharing your work! Looking forward to your reply!

whydaydayup commented 4 years ago

I am also woking on ubuntu 16.04 with ROS Kinetic, I also have the same problem! Wish you can help fix the problem, Thanks!

koide3 commented 4 years ago

Hi guys, I confirmed that the package can be built on Kinetic using LLVM toolchain (clang + lld). Try to pull the latest devel branch and:

sudo apt install clang-6.0 lld-6.0
sudo update-alternatives --install /usr/bin/ld ld /usr/bin/ld.lld-6.0 50
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-6.0 50
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-6.0 50
cd ~/catkin_ws && rm -rf build devel    # be aware of that this command removes build and devel directories
CC=clang CXX=clang++ catkin_make -DCMAKE_BUILD_TYPE=Release

If you want to revert ld to the default one (ld.bfd) after building the package, do:

sudo update-alternatives --install /usr/bin/ld ld /usr/bin/ld.bfd 10
sudo update-alternatives --config ld
# select ld.bfd

I try to update the code so that it works with gcc and ld on kinetic. But, it's low priority and no ETA so far.

rrkmiao commented 4 years ago

Thanks! I tried, but it still didn't work.

koide3 commented 4 years ago

@rrkmiao , Could you try to remove deval and build directories in catkin_ws before doing catkin_make?

WbHappy commented 4 years ago

@koide3 I can confirm that this works, both master and devel branch, when deleting build and devel directories.

So, using exactly those instructions as specified by @koide3, works perfectly :

sudo apt install clang-6.0 lld-6.0
sudo update-alternatives --install /usr/bin/ld ld /usr/bin/ld.lld-6.0 50
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-6.0 50
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-6.0 50
cd ~/catkin_ws && rm -rf build devel    # be aware of that this command removes build and devel directories
CC=clang CXX=clang++ catkin_make -DCMAKE_BUILD_TYPE=Release

Thanks again =).

QiukuZ commented 4 years ago

I dont understand why cd ~/catkin_ws && rm -rf build devel can fix this problem. Although I did pass the build after adding this instruction

koide3 commented 4 years ago

@QiukuZ catkin determines the compiler to be used when you run catkin_make first time. To change the compiler you have to remove build directory to force catkin to clear and reconfigure the build parameters cache.