CMake Warning - Cannot generate a safe linker search path Cmake tells you that IF you have same library in both usr lib and usr X11R6 lib it won't pick the good one It is very likely that usr X11R6 is a link to usr You can check it with this command
Cannot generate a safe runtime search path for target 可能的原因与解决方法 解决方法是删除旧的build文件夹,强制重新编译,以消除之前编译产生的影响。 摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 > 如果你在编译时遇到以下错误,那么你可能遇到了和我一样的问题。 仔细看警告说明,他说在 usr lib x86_64-linux-gnu 目录下的库文件可能与 usr local lib 目录下的库文件冲突。 我自己是在删除旧版本的PCL并安装新版本的PCL后出现的该问题。 去相关目录查看后发现, usr lib x86_64-linux-gnu 目录下是已经删除的旧版本PCL残留的库文件,而 usr local lib 目录下是新版本的需要的库文件。 我在CmakeLists中添加以下代码检查是否找到了正确的PCL版本
Just use the CMakeLists. txt settings and nothing else! [Solved with . . . For various reasons, the CMake process in CLion might have a different set of environment variables - could you please verify if it's the case by adding execute_process (COMMAND "$ {CMAKE_COMMAND}" "-E" "environment") somewhere in your CMakeLists txt, and compare its output in both cases?