unitreerobotics / unitree_mujoco

BSD 3-Clause "New" or "Revised" License
160 stars 42 forks source link

cannot find -lddsc&ddscxx #19

Open Sher1ockFan opened 1 month ago

Sher1ockFan commented 1 month ago

my system is ubuntu20.04 I have installed the unitreeSDK2 on my computer the path is /usr/local/ but there is an error about cannot find -lddsc&ddscxx occurred

juanjqo commented 1 month ago

@Sher1ockFan I'm experiencing the same issue. Did you find a solution?

webDrag0n commented 1 month ago

Same issue here, the -lddsc error could be solved by apt install cyclonedds-dev. However the -lddscxx still remains unfound. So I'm suspecting the problem is somehow related to building procedure of cyclonedds or the environment variable.

The README instruction says something about setting CYCLONEDDS_HOME and CMAKE_PREFIX_PATH. Not sure what should be set to CMAKE_PREFIX_PATH though, and doesn't seems to find ddscxx in cyclonedds install folder.

KanonWY commented 1 month ago

I don't know if the maintainer of the repository made a deliberate mistake or is not familiar with modern cmake.The solutions to these errors are:

find_package(unitree_sdk2 REQUIRED)
include_directories(/usr/local/include/ddscxx /usr/local/include/iceoryx/v2.0.2)
# link_libraries(unitree_sdk2 ddsc ddscxx rt pthread)
link_libraries(unitree_sdk2 ddsc rt pthread)

The link_target method is no longer recommended.

webDrag0n commented 1 month ago

Thanks so much for the solution! It worked flawlessly.

Sher1ockFan commented 1 month ago

@Sher1ockFan I'm experiencing the same issue. Did you find a solution?

I found the installation path was wrong It was /usr/local/lib/x86_64/ but it should be /usr/local/lib So you can move libddsc.so and libddscxx.so to the correct path sudo mv /usr/local/lib/x86_64/* /usr/local/lib/

KanonWY commented 1 month ago

It looks like a bug in the unitree_sdk2 cmake install script, there is a missing /, which causes the prefix. You can add this / and it will install to /usr/local/lib St1fQPRF67 My solution above may be wrong, but link_libraries is definitely not recommended. You can directly find_package and then use the transitivity of target_link_library to find the two missing libraries.

liujieluv commented 1 month ago

编译unitree_mujoco时出现,cannot find -lddsc&ddscxx #19

查找libddscxx.so

locate libddscxx.so

将libddscxx.so的位置链接到/usr/local/lib/libddscxx.so

sudo ln -s /home/liu/unitree_sdk2-main/thirdparty/lib/x86_64/libddscxx.so /usr/local/lib/libddscxx.so

locate libddsc.so

sudo ln -s /home/liu/unitree_sdk2-main/thirdparty/lib/x86_64/libddsc.so /usr/local/lib/libddsc.so

wuyangning commented 1 month ago

my system is ubuntu20.04 I have installed the unitreeSDK2 on my computer the path is /usr/local/ but there is an error about cannot find -lddsc&ddscxx occurred

The previous version of unitree_sdk2 was installed using install.sh. This method is no longer used in the new version. See https://github.com/unitreerobotics/unitree_sdk2. The installation paths of these two versions are inconsistent, resulting in compilation errors. We have fixed this issue in the latest commit.