首页 文章

header semaphore.h不能包含eclipse juno . 我收到错误“未解决的包含”

提问于
浏览
0

我试图测试C语言中有关多线程的教程中的代码 . 我在Windows 7,64x上安装了JUNO和Mingw以及Cygwin64 . 我还设置了变量路径 . 当我添加像stdio.h,pthread_time.h或fcntl.h这样的头文件时我没有任何问题但是当我尝试包含头文件semaphore.h或pthread.h时,eclipse会给出错误“未解决的包含” . 谁能帮我?任何帮助都非常感激 .

[评论更新:]

我正在使用:Eclipse IDE for C / C Developers版本:Juno Service Release 2,我有c版本4.7.0 . 但请记住我,这个程序是c .

这些是一些包括和我的方式:

#include <stdio.h> 
#include <pthread_time.h> 
#include <pthread_unistd.h> 
#include <semaphore.h> 
#include <pthread.h> 
#include <fcntl.h> 
#include<stdio.h>

int main(){
    printf("Hello World");
   }

正如我所说的不是所有人我都有问题,但只有semaphore.h和pthread.h我得到了错误 . 实际上我并不需要这些简单程序的所有 Headers ,但这只是一个例子 .

1 回答

  • 0

    所以解决方案比我想象的要容易:只需使用cygwin代替mingw,将项目作为工具链 .

相关问题