Web Programming Frameworks?

I'm thinking of trying to do Web Programming in C++ as well along with Python (where needed or applicable, and also because I want to see how easy or hard it really is), but I've been having trouble figuring out what the best C++ web framework is. I'm using Visual Studio Community 2015 on Windows 10, and I want to be able to build with my chosen framework from within the IDE or via LLVM Clang since I've installed that on my machine as well.

I tried using CMake to build Wt, but I just can't get CMake to find the CMakeLists.txt file. And I also followed the installation instructions for Wt on their website to get it to work on VS, too, but no luck. I even followed all the directions (on this page: http://redmine.webtoolkit.eu/projects/wt/wiki/Installing_Wt_on_MS_Windows).

I did use C++ REST SDK (Project Casablanca) on Visual Studio while following an introductory walkthrough, but I couldn't compile it on the command line with Clang.

I wonder if CppCMS would be better on Visual Studio?

Note: I'm still new to Web Programming and I plan to start more seriously after I've finished the C++ book I have right now as well as its follow-up book (both by Stroustrup). I do know some basic HTML/CSS/JavaScript, but I'd like to learn more, since I'm not fully confident in it yet (but I want to stay mainly on the back-end, hence the Web Programming thing).

I've joined Upwork as well so I can get some experience working on real C++ console and GUI apps (after I've learned GUI programming), but before that I'd like to know if any of the console apps I have know would be good on a portfolio. Should I attach the files to a post on Upwork and have someone look at them or what?
I looked at cppCMS and it looks like it has not been developed in years. Also, a quick google search turned up compelling reasons as to why c++ is not really the best tool for web frameworks. Ruby On Rails and Django are you best solid starting points for web frameworks IMO. I personally like Django, but that is purely because I am more familiar with it.

Just my two cents!
I just hope someone would help me out with setting up Wt, then.

And with C++14 and 17, isn't it getting easier to do web development in C++? I think it's more the fault of the people using C++ that everyone seems to think it's hard to use C++ or learn it, and that it's also their fault that so many people think C++ is not for web development.

Stroustrup preaches keeping things simple and not writing complicated or messy code in his PPP2 book. Google has PNaCl (Portable Native Client) which supports C++, Cloud9 seems to support Wt on the server-side, Microsoft has Casablanca.

And a good craftsman knows to blame his tools, right? So why blame C++ when it's a tool, and the main problem could also lie with the programmers themselves and with the way they use C++ not being web-friendly?
I have used Wt and as I remember you don't need to build it. Just compile with headers and link with Wt binaries - in your link http://redmine.webtoolkit.eu/projects/wt/wiki/Installing_Wt_on_MS_Windows its under "The Easy Method". Although C++ is far from being the most popular language for web applications on upwork.
Last edited on
Is there any reason you would want to use C++ for web services? There isn't necessarily anything wrong with that but if your intent is to learn everything you need to know to get a job you would be much better served spending your time learning nodeJS or ruby. C++ is an uncommon choice for modern web serving (not to say it doesn't happen, but it is hard to find C++ developers compared to javascript developers, so stacks are more fragile to dev movement)
We could use Asio or Boost.Asio Networking libraries until C++ gets the functionality built into it. It was originally planned for C++17, but it was moved into Technical Specifications for C++20 instead (along with some other things that they're considering for C++20, all of which (the Networking stuff included) are things Stroustrup wanted to be included into C++17). They're experimenting with Asio for the C++ Networking functionality, though, so I'm thinking why not just use that for now? We just have 3 years until the standards committee adds it to the language, hopefully.

To answer Wizebin's question on why I want to use it: It seems like there's enough support for it in Boost/Boost.Asio and other libraries and the standards committee also wants to let us do it. And I also really like C++ and would like to use it for Networking where I can, although I'll stick mostly with Python for it until the standards committee adds Networking support into the language.
Last edited on
You are missing that boost does not have Web stack implementation, it works on level just above sockets and doesn't go to HTTP or REST, so boost/C++20 is not what you need for web. Web sites in C++ are usually built on frameworks like Wt and are mostly used in embedded things like Wi-Fi routers web interfaces.
Last edited on
So the networking support that's being added to the standard isn't the kind that we need, then? If so, that would really suck.
Last edited on
Don't worry about whether or not something is in the standard, libraries are a fundamental component of software development.
Standard library, then. The committee wanted to add Networking support to the STL with C++17 but it turned out that the language and/or the users weren't ready for it (and for the other stuff Stroustrup wanted to add), so it was pushed back to C++20. They're looking at the Asio library for it, apparently, and what I'm asking is if that's the wrong approach since you said the Boost library doesn't have HTTP or REST support.
And I also followed the installation instructions for Wt on their website to get it to work on VS, too, but no luck.
What do you mean? I use Wt and it works fine. CMake creates project files for Visual Studio (if you say so) you can use to compile the framework. It comes with a few libraries plus a lot of examples (some of them may not compile, but that doesn't matter). So what is it that doesn't work?
Well, I was just having a hard time building Wt for some reason, so I installed the pre-built binaries. I'm learning C++ from Stroustrup's intro book right now and I'm pretty much a beginner in C++11 and C++14. I want to learn as much as I can about those standards and I just wanted to know about web programming and what there is available in C++ for that, for when I'm ready to get into web programming. I'll also learn Python and the Django framework, but I also like C++ a lot and want to use that where I can in web programming.

It seems like Boost Asio actually does support HTTP server and client handling and stuff. And Wt also uses the Boost library. So I don't know what @wizebin meant about it not having support for HTTP or REST.

I want to know where I can find good tutorials for using Boost Asio and Wt to write web applications. I installed Boost version 1.62.0 pre-built binaries since I couldn't find any for 1.63.0, and I read on Boost's website that there are some libraries that must still be built separately (Boost.Python being one of them). If that's true even for the pre-build binaries, it'd be helpful if I could see some tutorials that could help me build them.

Also, when I write an application that uses the Boost Asio libraries, how should I link my project against them and how should I write the #include lines for them? My Boost libraries are in the directory C:\local\boost_1_62_0\. Do I put them in MSVS' include directory? Same for Wt? So that MSVS has an easier time finding them if I just do "#include <Wt/name_of_library>" or "#include <boost/name_of_library>"?

Lastly, if I want to put a .exe file compiled from C++ code into a server as a server-side application, what do I have to do for that? And what webservers support this? Or does Boost Asio allow you to make your own webserver so you don't have to worry about that (if so, how?)? Does WAMP support it?
Last edited on
Topic archived. No new replies allowed.