Welcom to Raspberry C++ cgi program.(C++cgi-readme.txt) This program is written by C++ language for Raspberry Pi light http server Version-1.3.1. You can execute this C++ cgi on Raspberry Pi light http server Version-1.3.1. How to make 1] Download , copy and spread zip file. dowunload nishi-test-cpp-cgi.xxx.zip and unzuip to /home/your-id/workspace-raspi/ $cd /home/your-id/workspace-raspi/ unzip nishi-test-cpp-cgi.xxx.zip 1) Making libcgi_lib.a $cd nishi-test-cpp-cgi/src/cgi_lib $make clean $make 2) Making C++ CGI samples $cd nishi-test-cpp-cgi/ $sh ./make_c++.sh hello_cpp_cgi --> src/hello_cpp_cgi.cpp compile $sh ./make_c++.sh hello1_cpp_cgi $sh ./make_c++.sh hello2_cpp_cgi Attention. If you want to run these C++ CGI samples under an apache, please deploy them to the cgi-bin directory. 2] edit server.conf file (http_pic_t.v1.3.1). /home/your-id/www-raspi |-- /html <--- doc_rootdir |-- /images | index4.htm <-- sampe html for C++ cgi access /home/your-id/workspace-raspi/nishi-test-cpp-cgi <--- cgi_rootdir (perl cgi and C++ cgi) 3] start http_pic_t server(v1.3.1) $su -l pi pi>$cd ~your-id/workspace-raspi/http_pic_t.v1.3.1 pi>$sudo ./httpServer_t Then you can see index.htm by another pc browser(which is in a same network ex. 192.168.1.X). http://your-Raspberry-Pi-ip/index4.htm then you can see ~your-home/www-raspi/html/index4.htm index-file by your pc browser. 4] C++ cgi program sample. src/hello1_cpp_cgi.cpp Making a C++ CGI program is very easy. It only uses CGILite.cpp or CGI.cpp class to accept a GET or POST http request. ---- start C++ code ---- #include // printf #include // getenv #include // cout //#include #include #include "cgi_lib/CGILite.hpp" using namespace std; using namespace tr1; int main(int argc , char *argv[]){ CGILite _cgi; cout << "Content-Type: text/html\r\n\r\n"<\n" << "\n" << "\n" << "\n" << "\n" << "hello1_cpp_cgi\n" << "\n" << "\n" << "hello1 c++
\n" << "hello1_cpp_cgi excuting
\n" << "------ start ----------
\n"<::iterator itr; for(itr=_cgi.parms.begin();itr!=_cgi.parms.end();++itr){ cout << itr->first <<"=" << itr->second << "
\n"; } cout << "------ end ----------
\n" << "\n" << "\n"<