小编use*_*165的帖子

GCC编译失败,使用pthread和选项std = c99

我有一个示例程序无法使用-std = c99进行编译

任何帮助赞赏

#include <pthread.h>
int main(void) {
    pthread_rwlock_t    myLock;
    return 0;
}

output of the two compiles:
gcc pthread_test.c
[brad@fedora17onbradsmacpro src]$ gcc  pthread_test.c
[brad@fedora17onbradsmacpro src]$

gcc -std=c99 pthread_test.c[brad@fedora17onbradsmacpro src]$ gcc -std=c99 pthread_test.c
pthread_test.c: In function ‘main’:
pthread_test.c:5:2: error: unknown type name ‘pthread_rwlock_t’
[brad@fedora17onbradsmacpro src]$
Run Code Online (Sandbox Code Playgroud)

linux gcc fedora pthreads

8
推荐指数
1
解决办法
6307
查看次数

标签 统计

fedora ×1

gcc ×1

linux ×1

pthreads ×1