GNU cgicc

来自开放百科 - 灰狐
2008年2月12日 (二) 13:54Allen (讨论 | 贡献)的版本

跳转到: 导航, 搜索
GNU-cgicc.png

GNU cgicc is an ANSI C++ compliant class library that greatly simplifies the creation of CGI applications for the World Wide Web.

目录

Functions

  • Parses both GET and POST form data transparently.
  • Provides string, integer, floating-point and single- and multiple-choice retrieval methods for form data.
  • Provides methods for saving and restoring CGI environments to aid in application debugging.
  • Provides full on-the-fly HTML generation capabilities, with support for cookies.
  • Supports HTTP file upload.
  • Compatible with FastCGI.

Compilers

  • gcc versions 2.8.1 and greater
  • Hewlett-Packard aCC
  • Microsoft Visual C++ 6.0
  • Borland C++ Builder 5.0

Install

Download: ftp://ftp.cgicc.org/

Unpack: tar xzf cgicc-X.X.X.tar.gz

Build Libraries:

cd cgicc-X.X.X/
./configure 
 make
 make install 

Libraries:

/usr/lib/libcgicc.a

        libcgicc.la
        libcgicc.so             
        libcgicc.so.5            
        libcgicc.so.5.0.1

Include files: /usr/include/cgicc/...

Example

cd demo
sh ../libtool --mode=install cp *.cgi /var/www/cgi-bin/
修改 .html 文件中 cgi 的指向 
cp *.html /var/www/html
http://localhost/html/cookie.html
http://localhost/html/test.html
http://localhost/html/upload.html
http://localhost/cgi-bin/dns.cgi

testcgi.html
testcgi.cpp
g++ -o testcgi -I/usr/include testcgi.cpp /usr/lib/libcgicc.a // Compile and static link
g++ -o testcgi -I/usr/include testcgi.cpp -L/usr/lib/ -lcgicc // Dynamic Link (at run time)

Place web page in: /var/www/html/testcgi.html
Place cgi in: /usr/lib/cgi-bin/testcgi
restart Apache: service httpd start
Test: http://localhost/testcgi.html 

(from http://www.yolinux.com/TUTORIALS/LinuxTutorialC++CGI.html)

Links

分享您的观点
个人工具
名字空间

变换
操作
导航
工具箱