I've decided to write a Website in C++. I am sick of dealing with languages that layer on top of other languages, so I just want to write it in C++. I know about CGI++, but I was wondering if there were any other tools or methods used for writing a site in C++.

Other than for the pure challenge of doing it, I see no reason to write a web site in c++ since there are other markup languages more suited for the task. I don't write web sites but my guess is that not a single one of them were written in pure C or C++.

What's the need to reinvent the wheel? Do you have some special project that doesn't fits in any web oriented base language?

For example PHP is open source and based on C, so why not building the web site on that language?

You could certainly write a C++ program that could send the following output to stdout:

<html>
  <body>Hello World</body>
</html>

but I imagine you'd have to stick it in the cgi-bin folder and type

http://somesite/cgi-bin/helloword.cgi

in the browser. If you stick it in the html folder and try to browse to

http://somesite/helloword.html

it won't execute without some tweaking of permissions, mime types, configuration files, etc., so even if you want everything in C++, it's going to be a matter of doing at least SOME html, I would imagine, and calling your C++ program from there.

Hey Vernon,
Yes, I will have to mess with CGI. I will do it as Fast CGI with C++ for now and possibly convert it to pure C++ later.

I was hoping there were some tutorials or some really good documentation on this. I've been reading the documentation for fastcgi++, but the more you learn the better.

Edited 6 Years Ago by tiger86: n/a

What's the need to reinvent the wheel? Do you have some special project that doesn't fits in any web oriented base language?

For example PHP is open source and based on C, so why not building the web site on that language?

That is just it fantasma, PHP is BASED on C. Layered languages are usually like onions in my mind. I've used PHP, I've used rails. I believe it is better to write a project from scratch, not use something pre-packaged like PHP. That is purely my own belief and I am not going to force it on anyone else.

Ancient, Wordpress is written in C.

Edited 6 Years Ago by tiger86: n/a

Two C libraries that may be useful to you (libcurl and libxml). Most of the cgi programs I write are in C and I use these a lot. The website itself is written in Flex, with some PHP in there, but the CGIs are in C. These two libraries help a lot with GETing, POSTing, etc., and creating/parsing xml.

http://curl.haxx.se/libcurl/c/
http://xmlsoft.org/

You might also be interested in MySQL++, which I've used in the past for database interaction.

http://tangentsoft.net/mysql++/


Good luck!

I've been to a seminar in which the guy made up a website in C# with Visual Studio. However on later observation. Only the backend was written in C#. All of the front end was generated in HTML and php codes itself. Maybe you should check it out then.It myt suit your requirement.

Cause I'm sure that it will convert all source languages to its interpreter language.

Sorry If I'm wrong.

Vernon thank you for answering my question. Sky Diploma, I am thinking about using CGI and XSL for the front end.

I am an app developer for Apple. My apps can easily be ported to android. So I think it would be good to make my site as an app in C++, release it for mobile phones and then if that is succesful make the website.
Most Website usage is via mobile phones nowadays.

It is good to try c++ for a website you will find more challenges and it is cool. Although, I can make my own website using high-level language but I choose C++ for the website applications.

Edited 2 Years Ago by pritaeas: Removed self-promotion link.

"I'm sure tiger86 had been sitting in front of their computers for four years just waiting for your response. Good Job."

It makes me laugh even this will be the second time around.

credits to WaltP, his original post:

"I'm sure Ahmed and Vicky had been sitting in front of their computers for two years just waiting for your response. Good Job."

This question has already been answered. Start a new discussion instead.