读书人

[]同样的源文件同样的编译器编译出

发布时间: 2012-02-07 17:45:36 作者: rapoo

[求助]同样的源文件,同样的编译器,编译出来的bin能运行,cgi出现Segmentation Fault
同样的helloworld.c ,同样的编译器arm-linux-gcc 4.4.3
编译成bin可以运行,编译成.cgi就出现 Segmentation Fault

arm-linux-gcc -o helloworld helloworld.c
arm-linux-gcc -o helloworld.cgi helloworld.c

将以上两个拷到mini2440上,内核是Linux 2.6.36.2

在控制台下
helloworld可以运行,正常
helloworld.cgi不能运行 ,出现错误Segmentation Fault

有大侠能解答下吗?
多谢!!

C/C++ code
//helloworld.c#include<stdio.h>int main(){    printf("Content-type: text/html\n\n");    printf("<html>\n");    printf("<head><title>BOA CGI TEST</title></head>\n");    printf("<body>\n");    printf("<h1>BOA CGI TEST</h1>\n");    printf("</body>\n");    printf("</html>\n");    return 0;}


http://topic.csdn.net/u/20111222/16/d768197b-a82a-4f85-af2a-dcbacd619e6e.html

[解决办法]
或者你说说自己的解决过程和总结吧,下次有用。

读书人网 >CGI

热点推荐