有什么好的 C/C++ 网络工具包?

发布于 2024-08-01 13:12:51 字数 1542 浏览 6 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(13

沧桑㈠ 2024-08-08 13:12:52

您可能想查看 klone:

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

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

You might want to check out klone:

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

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

痴骨ら 2024-08-08 13:12:52

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

有 MVC 模块,例如 mod_spin 但我没有任何经验。

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

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

凉薄对峙 2024-08-08 13:12:52

C++ 对于 Web 应用程序来说并不是一个非常流行的选择 - 可能是因为它太简单了
留下安全漏洞,并且开发时间往往比
脚本语言。 我想说 99% 的 Web 应用程序不需要这样的速度
C++带来的。

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

从我对这个区域的相当简单的观察来看,我想说 Wt 可能是你最好的选择,尽管
它更像是一个有用的东西的库(例如页面模板)而不是一个框架。

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

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.

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.

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

咽泪装欢 2024-08-08 13:12:52

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

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

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

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

谜兔 2024-08-08 13:12:52

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

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.

随波逐流 2024-08-08 13:12:52

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

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

素染倾城色 2024-08-08 13:12:52
  1. http://www.webtoolkit.eu/wt#/
  2. http://cppcms.sourceforge.net/wikipp/en/page/main
  3. C++ Web 服务框架

对于初学者来说。 我确信还有更多 - 健康的谷歌搜索可能不会有什么坏处。 另外,您可以尝试 freenode 上的 #C++ 频道 - 他们有一个题外话频道,如果您想谈论非 STL C++,您可以询问该频道,我相信那里的人会很乐意回答您的问题。 祝你好运。

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

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.

白衬杉格子梦 2024-08-08 13:12:52

我尝试了一下 Wt,真的很喜欢它。 我不会告诉你从头开始使用它的任何缺点或优点,但是当你有一个用 C/C++ 编写的后端并有数百万个 API 条目时,那么 Wt 是一个明显的选择。 有一些非常强大且更易于使用的功能,例如动态加载的表。 服务器上的信号处理等。

我在 Wt 真正不喜欢的一件事是,截至撰写本文时,它与 Windows 上的 Apache 不兼容。 您要么必须使用 Unix,要么必须使用 Windows 上的 IIS。 Wt 还提供了自己的 http 服务器,这对于开发应用程序非常方便,但我不相信它作为生产服务器的角色,因为我不确定它的安全性。

I gave Wt a try and really liked it. I will not give you any cons or pros for using it from scratch, but when you have a backend written in C/C++ with millions of API entries then Wt is an obvious choice. There are some very powerful features that is easier to use for example dynamically loaded tables. Signal processing on the server etc.

One thing I really disliked at Wt is that it is not compatible with Apache on Windows as of time of this writing. You either have to use Unix, or IIS on Windows. Wt also offers its own http server, that is very convenient for developing your applications but I would not trust it in the role of production server as I am not sure of its security.

夏了南城 2024-08-08 13:12:52

Qt 将会日益成长。 Wt是试图代表基于Qt的Web工具包。 C++ 是一种功能强大的语言,也是我认为最好的语言。 如果您喜欢 GNU 项目和独立技术。 我真的建议使用它们。 我使用过 PHP、Phyton、C#、VisualBasic、Fortran 等,但我不太喜欢其中的 C++。

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.

梦中的蝴蝶 2024-08-08 13:12:52

另一种选择可能是“FastCGI / CGI C++ Library”,旨在有一天实现 Boost 集成:http://cgi.sourceforge .net/

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

夏花。依旧 2024-08-08 13:12:52

我个人对 Web 开发的选择是 Ruby on Rails,但如果您必须在 C、C++ 或 Java 之间进行 Web 开发选择,我的建议是使用 Java 和 JavaServer Faces

My personal choice for web development is Ruby on Rails, but if you have to chose between C, C++ or Java for web development, my suggestion is to use Java with JavaServer Faces

爱的故事 2024-08-08 13:12:52

Apache Celix 看起来是一个有前途的活跃项目,可以满足这个(尽管很旧)问题的要求。 请参阅:http://celix.apache.org/

从 Apache 项目描述页面:

Celix 是 OSGi 规范适应 C 的实现。它将尽可能遵循 API,但由于 OSGi 规范主要是为 Java 编写的,因此会存在差异(Java 是 OO,C 是过程式)。 实现的一个重要方面是 Java 和 C 之间的互操作性。这种互操作性是通过在 Celix 中移植和实现远程服务规范来实现的。

Apache Celix looks like a promising active project that meets the requirements of this (albeit old) question. See: http://celix.apache.org/

From the Apache Project description page:

Celix is an implementation of the OSGi specification adapted to C. It will follow the API as close as possible, but since the OSGi specification is written primarily for Java, there will be differences (Java is OO, C is procedural). An important aspect of the implementation is interoperability between Java and C. This interoperability is achieved by porting and implementing the Remote Services specification in Celix.

笑咖 2024-08-08 13:12:51

C++ 并不是一个很受欢迎的选择
Web 应用程序 - 可能是因为
很容易留下安全漏洞,
并且开发时间往往很长
比脚本编写慢
语言。

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

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

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

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.

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.

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 :-)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文