【已解决】cygwin下用arm-xscale-linux-gnueabi交叉编译libcgi出错:src/string.c:587:2: error: incompatible type for argument 2 of ‘__builtin_va_copy’

【问题】

折腾:

【记录】cygwin下用arm-xscale-linux-gnueabi交叉编译libcgi

期间,编译出错了:

CLi@PC-CLI-1 ~/develop/libcgi/libcgi-1.0
$ make CC=arm-xscale-linux-gnueabi-gcc
arm-xscale-linux-gnueabi-gcc    -c -o src/error.o src/error.c
arm-xscale-linux-gnueabi-gcc    -c -o src/cgi.o src/cgi.c
arm-xscale-linux-gnueabi-gcc    -c -o src/session.o src/session.c
arm-xscale-linux-gnueabi-gcc    -c -o src/base64.o src/base64.c
arm-xscale-linux-gnueabi-gcc    -c -o src/md5.o src/md5.c
arm-xscale-linux-gnueabi-gcc    -c -o src/string.o src/string.c
src/string.c: In function 'make_string':
src/string.c:587:2: error: incompatible type for argument 2 of '__builtin_va_copy'
src/string.c:587:2: note: expected '__va_list' but argument is of type 'char *'
<builtin>: recipe for target `src/string.o' failed
make: *** [src/string.o] Error 1

即:

src/string.c:587:2: error: incompatible type for argument 2 of ‘__builtin_va_copy’

【解决过程】

1.参考:

arm-linux-gcc 编译 libcgi

[Libcgi-general] src/string.c:587: incompatible type for argument 2 of `__builtin_va_copy’

去把:

libcgi-1.0\src\string.c

中的587行的:

	va_copy(bkp, str);

改为:

	//va_copy(bkp, str);
    va_copy(bkp, ptr);

再继续编译,就可以了:

CLi@PC-CLI-1 ~/develop/libcgi/libcgi-1.0
$ make CC=arm-xscale-linux-gnueabi-gcc
arm-xscale-linux-gnueabi-gcc    -c -o src/string.o src/string.c
arm-xscale-linux-gnueabi-gcc    -c -o src/general.o src/general.c
arm-xscale-linux-gnueabi-gcc    -c -o src/list.o src/list.c
arm-xscale-linux-gnueabi-gcc    -c -o src/cookie.o src/cookie.c
ar rc src/libcgi.a src/error.o src/cgi.o src/session.o src/base64.o src/md5.o  src/string.o src/general.o src/list.o src/cookie.o
arm-xscale-linux-gnueabi-gcc -shared -o src/libcgi.so src/error.o src/cgi.o src/session.o src/base64.o src/md5.o  src/string.o src/general.o src/list.o src/cookie.o



+---------------------------------------+
|       Thanks for using LibCGI         |
+---------------------------------------+
| LibCGI is getting better because      |
| people like you are using it. So, if  |
| LibCGI is helping you in some way,    |
| please help us to improve it, sending |
| suggestions, bug reports, bug fixes,  |
| and specially improvment code.        |
| You can subscribe to the mailing list |
| or send a mail to the author.         |
+---------------------------------------+---------------------------+
| List: http://lists.sourceforge.net/lists/listinfo/libcgi-general  |
+-------------------------------------------------------------------+

 

【总结】

arm-xscale-linux-gnueabi交叉编译libcgi出错

src/string.c:587:2: error: incompatible type for argument 2 of ‘__builtin_va_copy’

的解决办法:

去把:

libcgi-1.0\src\string.c

中的587行的:

va_copy(bkp, str);

改为:

//va_copy(bkp, str);
va_copy(bkp, ptr);

即可。



发表评论

电子邮件地址不会被公开。 必填项已用*标注

无觅相关文章插件,快速提升流量