8 #include <stdio.h>
9 #include "hlfs.h"
10
11 int main(int arg, char *argv[])
12 {
13 struct hlfs_ctrl *ctrl;
14 struct hlfs_stat stat;
15
16 ctrl = init_hlfs_by_config("./hlfs.config");
17
18 hlfs_stat(ctrl, &stat);
19
20 printf("hlfs name: %s.\n", stat.fsname);
21
22 return 0;
23 }
##############
编译过程:
1.添加HLFS的头文件,glib2.0头文件,如下
$ echo $C_INCLUDE_PATH
/usr/local/lib/hlfs/include/api:/usr/include/glib-2.0:/usr/lib/i386-linux-gnu/glib-2.0/include
$ echo $LIBRARY_PATH
/usr/local/lib/hlfs/lib
3.编译命令如下
$ gcc test_init.c -o test.out -lhlfs
但是在运行test.out是出错了:
$ ./test.out
./test.out: error while loading shared libraries: libhlfs.so: cannot open shared object file: No such file or directory
thanks! (:
--
Ren Zhen