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

Compilation failed in ROS Melodic #12

Closed
viniciusvidal2 opened this issue Jan 2, 2022 · 4 comments
Closed

Compilation failed in ROS Melodic #12

viniciusvidal2 opened this issue Jan 2, 2022 · 4 comments

Comments

@viniciusvidal2
Copy link

Hello everyone,

just faced a compilation failure in ROS Melodic regarding conflict between system libraries.

In file included from /usr/include/flann/util/serialization.h:9:0,
from /usr/include/flann/util/matrix.h:35,
from /usr/include/flann/flann.hpp:41,
from /usr/include/pcl-1.8/pcl/kdtree/flann.h:50,
from /usr/include/pcl-1.8/pcl/kdtree/kdtree_flann.h:45,
from /home/vinicius/uwo_ws/src/r3live/r3live/src/r3live.cpp:69:
/usr/include/flann/ext/lz4.h:196:57: error: conflicting declaration ‘typedef struct LZ4_stream_t LZ4_stream_t’
typedef struct { long long table[LZ4_STREAMSIZE_U64]; } LZ4_stream_t;
^~~~~~~~~~~~
In file included from /opt/ros/melodic/include/roslz4/lz4s.h:38:0,
from /opt/ros/melodic/include/rosbag/stream.h:46,
from /opt/ros/melodic/include/rosbag/chunked_file.h:46,
from /opt/ros/melodic/include/rosbag/bag.h:41,
from /home/vinicius/uwo_ws/src/r3live/r3live/./src/loam/include/common_lib.h:13,
from /home/vinicius/uwo_ws/src/r3live/r3live/src/r3live.cpp:59:
/usr/include/lz4.h:196:57: note: previous declaration as ‘typedef struct LZ4_stream_t LZ4_stream_t’
typedef struct { long long table[LZ4_STREAMSIZE_U64]; } LZ4_stream_t;
^~~~~~~~~~~~
In file included from /usr/include/flann/util/serialization.h:9:0,
from /usr/include/flann/util/matrix.h:35,
from /usr/include/flann/flann.hpp:41,
from /usr/include/pcl-1.8/pcl/kdtree/flann.h:50,
from /usr/include/pcl-1.8/pcl/kdtree/kdtree_flann.h:45,
from /home/vinicius/uwo_ws/src/r3live/r3live/src/r3live.cpp:69:
/usr/include/flann/ext/lz4.h:249:72: error: conflicting declaration ‘typedef struct LZ4_streamDecode_t LZ4_streamDecode_t’
typedef struct { unsigned long long table[LZ4_STREAMDECODESIZE_U64]; } LZ4_streamDecode_t;
^~~~~~~~~~~~~~~~~~
In file included from /opt/ros/melodic/include/roslz4/lz4s.h:38:0,
from /opt/ros/melodic/include/rosbag/stream.h:46,
from /opt/ros/melodic/include/rosbag/chunked_file.h:46,
from /opt/ros/melodic/include/rosbag/bag.h:41,
from /home/vinicius/uwo_ws/src/r3live/r3live/./src/loam/include/common_lib.h:13,
from /home/vinicius/uwo_ws/src/r3live/r3live/src/r3live.cpp:59:
/usr/include/lz4.h:249:72: note: previous declaration as ‘typedef struct LZ4_streamDecode_t LZ4_streamDecode_t’
typedef struct { unsigned long long table[LZ4_STREAMDECODESIZE_U64]; } LZ4_streamDecode_t;
^~~~~~~~~~~~~~~~~~
r3live/r3live/CMakeFiles/r3live_mapping.dir/build.make:62: recipe for target 'r3live/r3live/CMakeFiles/r3live_mapping.dir/src/r3live.cpp.o' failed

A solution can be found in the following link: ethz-asl/lidar_align#16

@ziv-lin
Copy link
Member

ziv-lin commented Jan 2, 2022

Try this?

sudo mv /usr/include/flann/ext/lz4.h /usr/include/flann/ext/lz4.h.bak
sudo mv /usr/include/flann/ext/lz4hc.h /usr/include/flann/ext/lz4.h.bak

sudo ln -s /usr/include/lz4.h /usr/include/flann/ext/lz4.h
sudo ln -s /usr/include/lz4hc.h /usr/include/flann/ext/lz4hc.h

@ziv-lin
Copy link
Member

ziv-lin commented Jan 2, 2022

It seems that you have solved your problem hahaha~

@viniciusvidal2
Copy link
Author

Thank you, these commands worked for me too like a charm! Now no one will get stuck with this in the future.

@Camilochiang
Copy link

@viniciusvidal2 close the issue if is solved ;)

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

3 participants