thread.cpp:(.text+0x82): undefined reference to `pthread_create'
时间: 2023-08-29 19:05:22 浏览: 165
undefined reference to ‘pthread_create’的解决方法
5星 · 资源好评率100%
这个错误出现在编译时,是因为在链接过程中找不到对应的pthread_create函数的定义。该函数属于pthread库,但在链接时没有使用正确的静态库libpthread.a。因此,需要在编译命令中明确指定使用pthread库,以解决该问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [undefined reference to ‘pthread_create’的解决方法](https://download.csdn.net/download/weixin_38698860/14890861)[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_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [Juliet Test make报错:std_thread.c:(.text+0xae): undefined reference to `pthread_create](https://blog.csdn.net/u013648063/article/details/115633638)[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_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [Linux:In function `main‘:xc.c:(.text+0x11c): undefined reference to `pthread_create‘xc....](https://blog.csdn.net/weixin_62979816/article/details/130534073)[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_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文