1

私はここに私のコードを持っています:

#define _GNU_SOURCE

#include "lib-ult.h"

#include <stdio.h>
#include <stdlib.h>

#include <ucontext.h>
#include <semaphore.h>

#define TRUE 1
#define FALSE 0
#define FAILURE -1

typedef struct Node {
    ucontext_t* context;
    int priority;

    struct Node* next;
    struct Node* prev;
} Node;

int STACK_SIZE = 16384;

sem_t queueLock;

sem_t threadsLock;

そして、プロジェクトをビルドしようとするとError 1 error C1083: Cannot open include file: 'ucontext.h': No such file or directory(およびsemaphore.hでも)得られます。

どうしてこれなの?どうすれば修正できますか?Windows マシンを使用しているという事実と関係がありますか?

ありがとうございました!

4

2 に答える 2

2

ucontext.hLinux パッケージのsemaphore.h一部です。linux-headersこのアプリケーションを Windows でコンパイルすることはできないと思います。Linux で仮想マシンをインストールし、そこでコンパイルしてみます。

于 2014-03-26T08:08:36.483 に答える