小さな c グループ内で cgroup を開始しようとすると、次のエラーが発生します。
In file included from /usr/include/libcgroup.h:24:0,
from simple_cgroup.h:28,
from simple_cgroup.cc:1: /usr/include/libcgroup/groups.h:108:8: error: forward declaration of
‘struct cgroup’ struct cgroup;
これらのヘッダーを使用するコードは次のとおりです。
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <fcntl.h>
#include <pthread.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <sched.h>
#include <string.h>
#include <unistd.h>
#include <libcgroup.h>
-lcgroup フラグを指定して g++ を使用してコンパイルします。
なぜこれが起こっているのかについての助けは大歓迎です