`

最新版本的gcc编译安装fcgi出错的解决办法

阅读更多

最近在折腾vps,在上面步骤ROR应用,部署方案还是用我倾向的Lighttpd + fcgi的方式,发现在编译安装fcig时出错,在网上搜也没有发现有价值的信息。

 

对于fcgi,我不管是用常规的 2.4.0版本,还是用最新的2.4.1(09年10月份发布的),都是出现如下的错误:

root@localhost:~/downloads/fcgi-2.4.1-SNAP-0910052249# ./configure --prefix=/usr/local/fcgi-2.4.1

这一步没有问题。

接下来

root@localhost:~/downloads/fcgi-2.4.1-SNAP-0910052249# make
make  all-recursive
make[1]: Entering directory `/root/downloads/fcgi-2.4.1-SNAP-0910052249'
Making all in libfcgi
make[2]: Entering directory `/root/downloads/fcgi-2.4.1-SNAP-0910052249/libfcgi'
if /bin/bash ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I..   -I../include  -g -O2 -MT fcgio.lo -MD -MP -MF ".deps/fcgio.Tpo" -c -o fcgio.lo fcgio.cpp; \
        then mv -f ".deps/fcgio.Tpo" ".deps/fcgio.Plo"; else rm -f ".deps/fcgio.Tpo"; exit 1; fi
 g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -MT fcgio.lo -MD -MP -MF .deps/fcgio.Tpo -c fcgio.cpp  -fPIC -DPIC -o .libs/fcgio.o
fcgio.cpp: In destructor 'virtual fcgi_streambuf::~fcgi_streambuf()':
fcgio.cpp:50: error: 'EOF' was not declared in this scope
fcgio.cpp: In member function 'virtual int fcgi_streambuf::overflow(int)':
fcgio.cpp:70: error: 'EOF' was not declared in this scope
fcgio.cpp:75: error: 'EOF' was not declared in this scope
fcgio.cpp: In member function 'virtual int fcgi_streambuf::sync()':
fcgio.cpp:86: error: 'EOF' was not declared in this scope
fcgio.cpp:87: error: 'EOF' was not declared in this scope
fcgio.cpp: In member function 'virtual int fcgi_streambuf::underflow()':
fcgio.cpp:113: error: 'EOF' was not declared in this scope
make[2]: *** [fcgio.lo] Error 1
make[2]: Leaving directory `/root/downloads/fcgi-2.4.1-SNAP-0910052249/libfcgi'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/downloads/fcgi-2.4.1-SNAP-0910052249'
make: *** [all] Error 2
root@localhost:~/downloads/fcgi-2.4.1-SNAP-0910052249#

 

我的gcc版本如下:

 

root@localhost:~/downloads/fcgi-2.4.1-SNAP-0910052249/include# gcc -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.1-4ubuntu8' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --disable-werror --with-arch-32=i486 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.4.1 (Ubuntu 4.4.1-4ubuntu8)
root@localhost:~/downloads/fcgi-2.4.1-SNAP-0910052249/include#

 

我想这个fcgi开发一点也不活跃,而gcc的最新版本不断出来,很有可能是由于这方面引的原因,我又调整了一下关键字

gcc compile fcgi,(之前都是没有方向的搜索)。终于在第一条结果中找到原因了:http://bugs.gentoo.org/256654

 

 

解决办法:

在/include/fcgio.h文件中加上 #include <cstdio>,然后再编译安装就通过了。

 

 

分享到:
评论
2 楼 hongfei_sr 2012-03-07  
找到答案了,多谢!
1 楼 coolesting 2011-08-30  
和你遇到一样的情况, 都是g++版本级别高了。

相关推荐

Global site tag (gtag.js) - Google Analytics