在运行ubuntu的服务器中构建FastCGI时出错

时间:2012-05-29 22:28:04

标签: c++ ubuntu cgi fastcgi

我想在运行ubuntu的服务器中将FCGI与我的C ++代码连接起来。我没有在FCGI网站的测试平台列表中找到ubuntu,但我还是尝试构建它。

./configure似乎没问题。但是,当我运行make时,我得到2个错误,粘贴如下:

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 '/home/giridhar/fcgi-2.4.1-SNAP-0910052249/libfcgi'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/giridhar/fcgi-2.4.1-SNAP-0910052249'
make: *** [all] Error 2

非常感谢帮助解决此问题。

1 个答案:

答案 0 :(得分:4)

我注意到EOF是一个C宏,它需要stdio.h而不包含在fcgio.cpp文件中。

在fcgio.cpp文件中添加#include <stdio.h>解决了这个问题,现在FCGI在Ubuntu上构建得很好。