安装websocketpp库后编译还报错:/usr/bin/ld: cannot find -lwebsocketpp collect2: error: ld returned 1 exit status t3/CMakeFiles/t3_node.dir/build.make:318: recipe for target '/smartview/devel/lib/t3/t3_node' failed make[2]: *** [/smartview/devel/lib/t3/t3_node] Error 1 CMakeFiles/Makefile2:3555: recipe for target 't3/CMakeFiles/t3_node.dir/all' failed make[1]: *** [t3/CMakeFiles/t3_node.dir/all] Error 2 Makefile:145: recipe for target 'all' failed make: *** [all] Error 2 ,如配置cmakefiles.txt
时间: 2023-08-16 10:03:45 浏览: 89
编译项目后,出现如下错误
这个错误提示表明链接器仍然无法找到websocketpp库。你可以尝试在CMakeLists.txt文件中添加链接websocketpp库的代码,如下所示:
```
find_package(websocketpp REQUIRED)
target_link_libraries(your_project_name websocketpp::websocketpp)
```
其中,your_project_name是你的项目名。这个代码片段会在链接你的项目时添加websocketpp库。如果仍然无法解决问题,你可以检查一下websocketpp库是否正确安装并且库的路径是否正确添加到系统路径中。
阅读全文