fcgio.cpp:50: error: 'EOF' was not declared in this scope

| 1 Comment

  编译安装FastCGI的时候遇到了错误:

source='fcgio.cpp' object='fcgio.lo' libtool=yes \
        depfile='.deps/fcgio.Plo' tmpdepfile='.deps/fcgio.TPlo' \
        depmode=gcc3 /bin/sh ../depcomp \
        /bin/sh ../libtool --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I..   -I../include  -g -O2 -c -o fcgio.lo `test -f fcgio.cpp || echo './'`fcgio.cpp
rm -f .libs/fcgio.lo
g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c fcgio.cpp -MT fcgio.lo -MD -MP -MF .deps/fcgio.TPlo  -fPIC -DPIC -o .libs/fcgio.lo
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:107: error: 'EOF' was not declared in this scope
make[2]: *** [fcgio.lo] Error 1
make[2]: Leaving directory `/root/fcgi-2.4.0/libfcgi'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/fcgi-2.4.0'
make: *** [all] Error 2

  经过一番搜索得知,需要在include/fcgio.h文件中加上 #include <cstdio>,然后再编译安装就通过了。

#ifndef FCGIO_H
#define FCGIO_H

#include <iostream>
#include <cstdio>
#include "fcgiapp.h"

本文结束。

1 Comment

………………

Leave a comment