vscode pthread_create 未定义的引用
时间: 2023-08-27 18:04:43 浏览: 271
在使用VSCode时,如果出现“pthread_create未定义”的引用错误,这通常是由于未正确链接pthread库导致的。为了解决这个问题,你需要在编译时添加-lpthread参数以显式链接该库。这样,编译器就能正确识别和链接pthread_create函数。例如,你可以通过在编译命令中添加-lpthread参数来解决这个问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [pthread_create未定义-报错:undefined reference to `pthread_create'](https://blog.csdn.net/u014470361/article/details/83214911)[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^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *3* [ubuntu(18):对‘pthread_create’未定义的引用](https://blog.csdn.net/BIT_HXZ/article/details/124229551)[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^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文