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} )
    
原文地址:https://www.cnblogs.com/BANLOONG/p/11549751.html