[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 下的。
谢谢
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.