DDD 3.3.11 (x86_64-redhat-linux-gnu) gets `Segmentation fault' signal
JEAN-PROST Frédéric (PRESTA EXT) <[email protected]> Mon, 10 Mar 2014 10:32:18 +0000
| Newsgroups | gmane.comp.debugging.ddd.general |
|---|---|
| Message-ID | <[email protected]> |
Dear, On a Red Hat Enterprise Linux Server 5.9. I use libgcc 3.2.9 and the testcgi.cpp is from http://www.yolinux.com/TUTORIALS/LinuxTutorialC++CGI.html I hope it'll help. Regards Frédéric Jean-Prost *********************************************************************************************** Ce message et toutes les pièces jointes sont confidentiels et établis à l'intention exclusive de son ou ses destinataires. Si vous avez reçu ce message par erreur, merci d'en avertir immédiatement l'émetteur et de détruire le message. Toute modification, édition, utilisation ou diffusion non autorisée est interdite. L'émetteur décline toute responsabilité au titre de ce message s'il a été modifié, déformé, falsifié, infecté par un virus ou encore édité ou diffusé sans autorisation. *********************************************************************************************** This message and any attachments are confidential and intended for the named addressee(s) only. If you have received this message in error, please notify immediately the sender, then delete the message. Any unauthorized modification, edition, use or dissemination is prohibited. The sender shall not be liable for this message if it has been modified, altered, falsified, infected by a virus or even edited or disseminated without authorization. ***********************************************************************************************
testcgi.cpp
(text/plain, 2.6 KB)
#include <iostream>
#include <vector>
#include <string>
#include "cgicc/CgiDefs.h"
#include "cgicc/Cgicc.h"
#include "cgicc/HTTPHTMLHeader.h"
#include "cgicc/HTMLClasses.h"
#include <stdio.h>
#include <stdlib.h>
using namespace std;
using namespace cgicc; // Or reference as cgicc::Cgicc formData; below in object instantiation.
int main(int argc, char **argv)
{
try {
Cgicc formData;
// Send HTTP header: Content-type: text/html
cout << HTTPHTMLHeader() << endl;
// Print: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
cout << HTMLDoctype(HTMLDoctype::eStrict) << endl;
// Print: <html lang="en" dir="LTR">
cout << html().set("lang", "EN").set("dir", "LTR") << endl;
// Set up the HTML document
cout << html() << head() << title("Cgicc example") << head() << endl;
cout << body().set("bgcolor","#cccccc").set("text","#000000").set("link","#0000ff").set("vlink","#000080") << endl;
cout << h1("This is a demonstration of the GNU CgiCC library") << endl;
form_iterator fvalue1 = formData.getElement("value1");
if( fvalue1 != (*formData).end() && !fvalue1->isEmpty() ) {
cout << "Value1: " << **fvalue1 << endl;
}
else
cout << "No text entered for value1" << endl;
cout << p();
form_iterator fvalue2 = formData.getElement("value2");
if( fvalue2 != (*formData).end() && !fvalue2->isEmpty()) {
// Note this is just a different way to access the string class.
// See the YoLinux GNU string class tutorial.
cout << "Value2: " << (**fvalue2).c_str() << endl;
}
else
cout << "No text entered for value2" << endl;
cout << p();
form_iterator fvalue3 = formData.getElement("value3");
if( fvalue3 != (*formData).end() && !fvalue3->isEmpty() ) {
cout << "Value3: " << **fvalue3 << endl;
}
else
cout << "No text entered for value3" << endl;
cout << p();
form_iterator fvalue4 = formData.getElement("value4");
if( fvalue4 != (*formData).end() && !fvalue4->isEmpty() ) {
cout << "Value4: " << **fvalue4 << endl;
}
else
cout << "No text entered for value4" << endl;
// Close the HTML document
cout << body() << html();
}
catch(exception& e) {
// handle any errors here.
cout << "ERROR!!" << endl;
}
return 0; // To avoid Apache errors.
}
log
(application/octet-stream, 584 B) - not displayed