undefined reference to symbol 'XConvertSelection'
时间: 2023-08-16 11:13:09 浏览: 342
问题中提到的错误"undefined reference to symbol 'XConvertSelection'"是由于缺少对X11库的链接导致的。根据引用\[1\]和引用\[2\]的建议,在CMakeLists.txt文件的target_link_libraries中添加"-lX11"可以解决这个问题。如果问题仍然存在,可以尝试在CMakeLists.txt中添加"find_package(X11 REQUIRED)",并在target_link_libraries中添加"${X11_Xrandr_LIB}"、"${X11_Xi_LIB}"、"${X11_Xrender_LIB}"、"${X11_Xdamage_LIB}"、"${X11_Xext_LIB}"、"${X11_X11_LIB}"、"${X11_Xinerama_LIB}"、"${X11_Xcursor_LIB}"来链接X11库。\[2\]
#### 引用[.reference_title]
- *1* [Ubuntu下GLFW和GLEW编译错误解决总结](https://blog.csdn.net/gaiyonghuming110/article/details/103471072)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* *3* [ubuntu20+dlib19.22+0pencv4.5.0的机器视觉算法之路(一)](https://blog.csdn.net/weixin_39735688/article/details/120958148)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文