Linux+CLion+树莓派远程编译时,Cmake编译出现undefined reference to 'dlopen'的解决办法

时间:2023-03-08 23:45:25
Linux+CLion+树莓派远程编译时,Cmake编译出现undefined reference to 'dlopen'的解决办法
  1. 在Clion中链接讯飞的语音库并传至树莓派上编译时,出现如下错误。

    undefined reference to `dlopen'
    undefined reference to `dlclose'
    undefined reference to `dlerror'
    undefined reference to `dlsym'
  2. 在CMakeList.txt中添加以下命令

    target_link_libraries(your_exec ${CMAKE_DL_LIBS} )