- 论坛徽章:
- 0
|
试验密钥环出现了个问题: 写了个简单函数调用add_key(),
1 #include <keyutils.h>
2 int main(int argc, char ** argv)
3 {
4 int rc;
5 char * dec = "1234567a";
6 char * key = "12345679a";
7 int key_size = 9;
8 add_key("user", dec, (void*)key, 9, KEY_SPEC_USER_KEYRING);
9 if(rc == -1)
10 {
11 return -1;
12 }
13
14 return 0;
15
16 }
但是编译出现问题:
1 all:
2 gcc -lkeyutils test.c -o test
/usr/include/keyutils.h:101: 错误:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/keyutils.h:116: 错误:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/keyutils.h:118: 错误:expected declaration specifiers or ‘...’ before ‘uid_t’
/usr/include/keyutils.h:118: 错误:expected declaration specifiers or ‘...’ before ‘gid_t’
/usr/include/keyutils.h:120: 错误:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/keyutils.h:128: 错误:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/keyutils.h:131: 错误:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/keyutils.h:137: 错误:expected declaration specifiers or ‘...’ before ‘size_t’
test.c: 在函数‘main’中:
test.c:10: 错误:提供给函数‘add_key’的实参太多
哪位大神指点一下。
|
|