gpt4 book ai didi

linux - 在eclipse中编译linux C++

转载 作者:太空宇宙 更新时间:2023-11-04 04:14:38 26 4
gpt4 key购买 nike

我正在尝试编译一个 C++ 项目。
我收到一个错误,指出 mutex.h 丢失。
1)linux中read hat中的所有include都在哪里?
2)我应该将它包含在 eclispe 中的哪里?

斯帕西瓦

最佳答案

您没有提及您尝试使用哪种类型的互斥体:

如果是 pthread 互斥体,则:

#include <pthread.h>

如果是 C++11 互斥体,则:

#include <mutex>

(您还需要使用 -std=c++11 进行编译)。

关于linux - 在eclipse中编译linux C++,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17259005/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com