- 论坛徽章:
- 0
|
我添加了readline库。所以加了 -lreadline参数,可以编译通过。- sgq@sgq-PC-MY28VCZEE:~$ gcc ladsh.c -o ladsh -lreadline
- ladsh.c: In function ‘getCommand’:
- ladsh.c:85:2: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘char *’ [-Wformat]
- ladsh.c:116:2: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘char *’ [-Wformat]
- ladsh.c: In function ‘main’:
- ladsh.c:726:5: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘char *’ [-Wformat]
- ladsh.c:731:5: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘char *’ [-Wformat]
复制代码 但是这次需要用客户指定的gcc来编译,找不到这些头文件?有什么办法?- sgq@sgq-PC-MY28VCZEE:~$ /usr/src/alta/toolchain/buildroot-2009.05/build_mips/staging_dir/usr/bin/mips-linux-uclibc-gcc
- ladsh.c -o ladsh -lreadline
- ladsh.c:15:30: error: readline/history.h: No such file or directory
- ladsh.c:16:31: error: readline/readline.h: No such file or directory
- ladsh.c: In function 'getCommand':
- ladsh.c:107: warning: assignment makes pointer from integer without a cast
- sgq@sgq-PC-MY28VCZEE:~$
复制代码 谢谢
|
|