如何将Indy组件添加到C ++ Builder项目?

问题描述:

当我尝试将它们添加到一个空项目中时出现未定义的错误。在Delphi中,您只需添加一个用途。

I get undefined errors when I try to add them to an empty project. In Delphi you'd just add a 'uses'. Are there any tutorials on this?

例如,添加:

TIdHTTP test*=new TIdHTTP;

产生:未定义符号:TIdHTTP

目标平台是Win32版本。我正在使用RAD 10 Studio Seattle Version 23.0

Target platform is Win32 Release. I'm using RAD 10 Studio Seattle Version 23.0

我的工具调色板是什么样子

Delphi的 uses的C ++等效版本子句是C ++头文件的 #include 语句。

The C++ equivalent of Delphi's uses clause is #include statements for C++ header file.

在这种情况下,要使用在C ++中 TIdHTTP ,您需要在C ++代码中使用 #include< IdHTTP.hpp> 语句,并确保Indy的头文件位于项目的包含搜索路径中的文件夹中。如果在设计时在Form / Frame / DataModule上放置 TIdHTTP 组件,则IDE将生成 #include 为您声明。否则,您必须手动添加它。

In this case, to use TIdHTTP in C++, you need an #include <IdHTTP.hpp> statement in your C++ code, and make sure Indy's header files are in a folder in your project's Includes search path. If you drop a TIdHTTP component on a Form/Frame/DataModule at design-time, the IDE will generate the #include statement for you. Otherwise you have to add it manually.