首页 新闻 会员 周边 捐助

这个错误要怎么办unknown type name 'clock_t'

0
[已关闭问题] 关闭于 2018-10-28 09:50
[zz@localhost trunk]$ x86_64-w64-mingw32-gcc word2vec.c -o word2vec.exe
word2vec.c:19:10: error: #include expects "FILENAME" or <FILENAME>
 #include pthread.h
          ^
word2vec.c:46:1: error: unknown type name 'clock_t'
 clock_t start;
 ^
word2vec.c: In function 'TrainModelThread':
word2vec.c:368:3: error: unknown type name 'clock_t'
   clock_t now;
   ^
word2vec.c:381:63: error: 'CLOCKS_PER_SEC' undeclared (first use in this function)
          word_count_actual / ((real)(now - start + 1) / (real)CLOCKS_PER_SEC * 1000));
                                                               ^
word2vec.c:381:63: note: each undeclared identifier is reported only once for each function it appears in
word2vec.c: In function 'TrainModel':
word2vec.c:547:3: error: unknown type name 'pthread_t'
   pthread_t *pt = (pthread_t *)malloc(num_threads * sizeof(pthread_t));
   ^
word2vec.c:547:20: error: 'pthread_t' undeclared (first use in this function)
   pthread_t *pt = (pthread_t *)malloc(num_threads * sizeof(pthread_t));
                    ^
word2vec.c:547:31: error: expected expression before ')' token
   pthread_t *pt = (pthread_t *)malloc(num_threads * sizeof(pthread_t));
                               ^
word2vec.c:556:84: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   for (a = 0; a < num_threads; a++) pthread_create(&pt[a], NULL, TrainModelThread, (void *)a);
                                                                                    ^
[zz@localhost trunk]$ x86_64-w64-mingw32-gcc word2vec.c -o word2vec.exe
word2vec.c:46:1: error: unknown type name 'clock_t'
 clock_t start;
 ^
word2vec.c: In function 'TrainModelThread':
word2vec.c:368:3: error: unknown type name 'clock_t'
   clock_t now;
   ^
word2vec.c:381:63: error: 'CLOCKS_PER_SEC' undeclared (first use in this function)
          word_count_actual / ((real)(now - start + 1) / (real)CLOCKS_PER_SEC * 1000));
                                                               ^
word2vec.c:381:63: note: each undeclared identifier is reported only once for each function it appears in
word2vec.c: In function 'TrainModel':
word2vec.c:556:84: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   for (a = 0; a < num_threads; a++) pthread_create(&pt[a], NULL, TrainModelThread, (void *)a);
                                                                                    ^

第一次在centos下编译exe。
出现这种错误,不知道怎么办??

直接make出来的,可以运行。但我想要在win下的。
谢谢

还没有的主页 还没有 | 小虾三级 | 园豆:531
提问于:2018-10-05 17:19
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册