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

Error while building FastCGI in a server running ubuntu

本文关键字:构建 FastCGI 出错 服务器 运行 ubuntu      更新时间:2023-10-16

我想在运行 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

帮助

解决此问题将不胜感激。

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

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