cmake连接动态库
时间: 2023-10-10 16:04:41 浏览: 152
动态连接库
在使用CMake连接动态库时,可以使用两个命令: link_directories和target_link_libraries。首先,link_directories命令可以用于指定动态库所在的目录,然后使用target_link_libraries命令将动态库链接到目标项目中。这样,在项目编译时,CMake会根据CMakeLists.txt文件引导make进行编译,同时将动态库链接到项目中。具体的使用方法可以参考引用中提到的命令以及引用中的示例。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [(十)CMake链接已有的动态库](https://blog.csdn.net/weixin_39258979/article/details/115078225)[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^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [cmake添加动态链接库](https://blog.csdn.net/Joshua_bu/article/details/90304150)[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^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [redis plus plus 动态库和静态库文件](https://download.csdn.net/download/weixin_39493350/62409904)[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^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文