apache 任何好的 C/C++ web 工具包?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1252201/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-13 18:03:09  来源:igfitidea点击:

Any good C/C++ web toolkit?

c++apachecgi

提问by ZeroCool

I've been looking around and came across the WT toolkit, Is it stable? Any good? I was stumped on how to go about this in C++, given the lack of libraries and resources concerning web developement. (CGI/Apache)

我一直在环顾四周,遇到了WT工具包,它稳定吗?有什么好处?鉴于缺乏有关 Web 开发的库和资源,我对如何在 C++ 中进行处理感到困惑。(CGI/阿帕奇)

The purpose of my application is to populate some data from a Sybase ASE15 database running GNU/Linux & Apache Hence allow some user interactions.

我的应用程序的目的是从运行 GNU/Linux 和 Apache 的 Sybase ASE15 数据库中填充一些数据,因此允许一些用户交互。

I am going to use Sybase open client library (libct) to retrieve columns from the Server, feed this data back to wt model/view.

我将使用 Sybase 开放客户端库 (libct) 从服务器检索列,将此数据反馈给 wt 模型/视图。

My requests:

我的要求:

Is there any more practical solution rather than using other scripting languages? I mean by practical, an interface with ODBC retrieving, and MVC mechanism?

有没有比使用其他脚本语言更实用的解决方案?我的意思是实用,具有 ODBC 检索和 MVC 机制的接口?

If not available in C++, any alternative in Java?

如果在 C++ 中不可用,那么在 Java 中还有其他选择吗?

采纳答案by Shaun

Give this one a look. I never much liked Wt's design. But then, I'm kind of an anti-framework guy.

看看这个。我一直不太喜欢 Wt 的设计。但是,我是一个反框架的人。

http://cppcms.sourceforge.net/wikipp/en/page/main

http://cppcms.sourceforge.net/wikipp/en/page/main

回答by Laryx Decidua

C++ isn't a very popular choice for web applications - probably because it's too easy to leave security holes, and development time tends to be a lot slower than for the scripting languages.

C++ 不是 Web 应用程序的一个非常流行的选择——可能是因为它太容易留下安全漏洞,而且开发时间往往比脚本语言慢很多。

Dynamically typed scripting languages convert compile-time errors to runtime errors. Detecting those might not be as easy as reading through the compiler output. Scripting languages may be OK for quick-and-dirty simple projects. Beyond a certain level of complexity one needs strongly typed, well-structured languages. Such as C++, or Java.

动态类型脚本语言将编译时错误转换为运行时错误。检测这些可能不像阅读编译器输出那么容易。脚本语言可能适用于快速而肮脏的简单项目。除了一定程度的复杂性之外,还需要强类型、结构良好的语言。比如C++,或者Java。

Most scripting languages encourage sloppy programming.

大多数脚本语言鼓励草率编程。

As to the "security holes": if you refer to buffer overruns, allocation/deallocation errors, the answer is "STL". And proper training of course :-)

至于“安全漏洞”:如果您指的是缓冲区溢出、分配/解除分配错误,答案是“STL”。当然还有适当的培训:-)

回答by radicalmatt

  1. http://www.webtoolkit.eu/wt#/
  2. http://cppcms.sourceforge.net/wikipp/en/page/main
  3. C++ web service framework
  1. http://www.webtoolkit.eu/wt#/
  2. http://cppcms.sourceforge.net/wikipp/en/page/main
  3. C++网络服务框架

For starters. There are certainly more I'm sure - a healthy google search probably wouldn't hurt. Also, you could try the #C++ channel on freenode - they have an offtopic channel that you can ask about if you want to talk about non STL C++ and the people there would happily answer your questions I'm sure. Good Luck.

对于初学者。我敢肯定还有更多 - 一个健康的谷歌搜索可能不会受到伤害。此外,您可以在 freenode 上尝试 #C++ 频道 - 他们有一个 offtopic 频道,您可以询问您是否想谈论非 STL C++,我相信那里的人会很乐意回答您的问题。祝你好运。

回答by Tommi

tntnet (http://www.tntnet.org) is great for creating web applications with C++.

tntnet (http://www.tntnet.org) 非常适合使用 C++ 创建 Web 应用程序。

回答by dicroce

You might want to check out klone:

您可能想查看克隆:

http://koanlogic.com/klone/index.html

http://koanlogic.com/klone/index.html

Basically, it's a framework AND server that makes writing C++ web backends easy...

基本上,它是一个框架和服务器,使编写 C++ 网络后端变得容易......

回答by dicroce

CGI programs are pretty damn easy to write in both C and C++ - you don't really need any special library, though having one will obviously make development a little faster. Do you really understand how CGI works? Basically, your program reads environment variables with getenv(), does some processing, and then writes some HTML out to the program's standard output.

CGI 程序在 C 和 C++ 中都非常容易编写——你真的不需要任何特殊的库,尽管拥有一个显然会让开发更快一点。你真的了解CGI的工作原理吗?基本上,您的程序使用 getenv() 读取环境变量,进行一些处理,然后将一些 HTML 写入程序的标准输出。

回答by Colin Coghill

C++ isn't a very popular choice for web applications - probably because it's too easy to leave security holes, and development time tends to be a lot slower than for the scripting languages. I'd say 99% of web applications don't need the speed that C++ brings.

C++ 不是 Web 应用程序的一个非常流行的选择——可能是因为它太容易留下安全漏洞,而且开发时间往往比脚本语言慢很多。我想说 99% 的 Web 应用程序不需要 C++ 带来的速度。

So this leads to a lack of good frameworks.

所以这导致缺乏好的框架。

From my fairly light look at the area I'd say Wt is probably your best bet, although it's more of a library of useful things (like page templates) than a framework.

从我对该领域的相当浅薄的看法来看,我认为 Wt 可能是您最好的选择,尽管它更像是一个有用的东西(如页面模板)而不是框架。

I'd seriously consider not doing this in C++ though. Even Java (I prefer C++ myself) has much stronger support for web development.

不过,我会认真考虑不要在 C++ 中这样做。甚至 Java(我自己更喜欢 C++)也对 Web 开发有更强大的支持。

回答by ZZ Coder

The best web toolkit for C/C++ would be Apache httpd. Just write a module and you can use libct to access your database.

最好的 C/C++ 网络工具包是 Apache httpd。只需编写一个模块,您就可以使用 libct 访问您的数据库。

There is MVC modules out there like mod_spinbut I don't have any experience with it.

有像mod_spin这样的 MVC 模块,但我没有任何经验。

回答by Christian

Another alternative may be the "FastCGI / CGI C++ Library" that is aimed for Boost integration at someday: http://cgi.sourceforge.net/

另一种选择可能是“FastCGI / CGI C++ 库”,旨在某一天进行 Boost 集成:http: //cgi.sourceforge.net/

回答by randyboy

Qt is going to grow day by day. And Wt is the trying to stand for web tool kit based on Qt. C++ the powerful language and the best in my opinion. If you like gnu projects and independent tech. I really suggest to use them. I used PHP, Phyton, C#, VisualBasic, Fortran etc. but I did not like as much as C++ among of them.

Qt 会一天天成长。而 Wt 是试图代表基于 Qt 的 Web 工具包。C++ 是强大的语言,在我看来是最好的。如果您喜欢 gnu 项目和独立技术。我真的建议使用它们。我使用过 PHP、Phyton、C#、VisualBasic、Fortran 等,但我不喜欢其中的 C++。