Borland 无法编译。 到底是怎么回事? 我什至无法开始

发布于 2024-07-27 03:44:56 字数 1324 浏览 3 评论 0原文

考虑:

cd C:\BORLAND\BCC55\BIN
bcc32 hello.cpp

输出:

Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
hello.cpp:
Error E2209 hello.cpp 2: Unable to open include file 'iostream'
Error E2090 hello.cpp 6: Qualifier 'std' is not a class or namespace name in fun
ction main()
Error E2379 hello.cpp 6: Statement missing ; in function main()
*** 3 errors in Compile ***

我阅读了 Embarcadero 的说明。 现在,它说...

#include <iostream.h>
int main(void)
{
    cout << "Hello." << endl;
    return 0;
}

编译:

cd C:\Borland\BCC55\Bin\MySource
bcc32 hello.cpp

输出:

Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
hello.cpp:
Error E2209 hello.cpp 1: Unable to open include file 'iostream.h'
Error E2451 hello.cpp 4: Undefined symbol 'cout' in function main()
Error E2451 hello.cpp 4: Undefined symbol 'end' in function main()
Error E2379 hello.cpp 4: Statement missing ; in function main()
*** 4 errors in Compile ***

Consider:

cd C:\BORLAND\BCC55\BIN
bcc32 hello.cpp

Output:

Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
hello.cpp:
Error E2209 hello.cpp 2: Unable to open include file 'iostream'
Error E2090 hello.cpp 6: Qualifier 'std' is not a class or namespace name in fun
ction main()
Error E2379 hello.cpp 6: Statement missing ; in function main()
*** 3 errors in Compile ***

I read the instructions at Embarcadero. Now, it says...

#include <iostream.h>
int main(void)
{
    cout << "Hello." << endl;
    return 0;
}

Compile:

cd C:\Borland\BCC55\Bin\MySource
bcc32 hello.cpp

Output:

Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
hello.cpp:
Error E2209 hello.cpp 1: Unable to open include file 'iostream.h'
Error E2451 hello.cpp 4: Undefined symbol 'cout' in function main()
Error E2451 hello.cpp 4: Undefined symbol 'end' in function main()
Error E2379 hello.cpp 4: Statement missing ; in function main()
*** 4 errors in Compile ***

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

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

发布评论

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

评论(5

九局 2024-08-03 03:44:56

说真的,如果你继续使用 Borland 的编译器,你将会遇到麻烦。 它从他们的计算机博物馆中免费开放是有原因的 - 它很古老。 版权线本身就足以证明这一点:

用于 Win32 的 Borland C++ 5.5.1 版权所有 (c) 1993, 2000 Borland

您真的想要一个几十年来没有更新过、标准早已落后的编译器吗?

如果您对老式计算感兴趣,与使用 TRS-80 和 Apple II 仿真器的人处于同一水平,那么您将得到这个编译器:-)

下载 Microsoft Visual C++ Express 并安装它。 它与 Borland 一样免费(就成本而言),而且更新得多。 请参阅此处了解产品页面。

或者,您还可以免费获得许多其他更新的开发工具,例如 gccCode::Blocks 等。

Seriously, you're going to keep having troubles if you continue to use Borland's compiler. It's free from their computer museum for a reason - it's ancient. The copyright line itself should be proof enough of that:

Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland

Do you really want a compiler that hasn't been updated in decades, one that the standard has long since left behind?

It's the compiler you get if you're interested in vintage computing stuff, in the same league as people with TRS-80 and Apple II emulators :-)

Download Microsoft Visual C++ Express and install it. It's as free (as in cost) as the Borland one and substantially more up to date. See here for the product page.

Or there are many other more up-to-date development tools you can get for free as well, such as gcc, Code::Blocks and so forth.

你怎么敢 2024-08-03 03:44:56

第一个错误在安装说明中提供了解决方案。

The first error has a resolution in the installation instructions.

小…楫夜泊 2024-08-03 03:44:56

如果您想坚持使用 Borland 产品,可以安装 Turbo C++。 我说的是“Turbo Explorer”工作中的 2006 Turbo C++ 部分,旨在恢复一些90 年代 Turbo C++ 的流行。

他们吹嘘“Turbo C++ 包含对行业标准 ANSI C 和 ISO/ANSI C++ 语言和库的支持。Turbo C++ 还包括 Dinkumware C++ 运行时库和对流行的 Boost 库的支持。”

我认为 2006 年的实现应该足够不错,但不像 Visual Studio Express 2005/2008 那样流行。

关于编译问题,必须摆弄bin目录(本例中为C:\BORLAND\BCC55\BIN)中的两个配置文件,即bcc32.cfg和ilink32.cfg。 编译器找不到 iostream.h 文件。

If you want to stick to Borland products you can install Turbo C++. I'm talking about the 2006 Turbo C++ part of the "Turbo Explorer" effort to bring back some of the popularity of the 90's Turbo C++.

They brag with "Turbo C++ contains support for the industry standard ANSI C and ISO/ANSI C++ languages and libraries. Turbo C++ also includes the Dinkumware C++ runtime libraries and support for the popular Boost library."

I think that a 2006 implementation should be decent enough, somehow not so popular like Visual Studio Express 2005/2008.

Regarding the compilation problems, one must fiddle with the two configuration files found in the bin directory (in this case C:\BORLAND\BCC55\BIN), namely bcc32.cfg and ilink32.cfg. The compiler cannot find the iostream.h file.

折戟 2024-08-03 03:44:56

在 C:\Borland\bcc55\bin 中创建两个文件

使用以下内容编辑其信息:

在文件 BCC32.cfg

      -I"c:\Borland\Bcc55\include"

      -L"c:\Borland\Bcc55\lib"

创建另一个名为 ILINK32.cfg 的文件strong>

      -L"c:\Borland\Bcc55\lib"

现在使用您的编译器,不要忘记

      #include<iostream>

      using namespace std;

在标题部分添加。

Create two files inside C:\Borland\bcc55\bin

Edit its information with following:

In file BCC32.cfg

      -I"c:\Borland\Bcc55\include"

      -L"c:\Borland\Bcc55\lib"

Create another file with name ILINK32.cfg

      -L"c:\Borland\Bcc55\lib"

Now use your compiler and don't forget to add

      #include<iostream>

      using namespace std;

in the heading section.

So尛奶瓶 2024-08-03 03:44:56

“iostream.h”不是标准 C++ 头文件。 某些编译器提供它是为了旧版支持,但您应该始终仅使用“iostream”。 旧版和标准版之间的主要区别在于 std 命名空间。 要拥有示例的兼容版本,它看起来像这样:

#include <iostream>
using namespace std; // import the contents of the std namespace
                     // into the global namespace

int main() {
    cout << "Hello." << endl;
    return 0;
}

"iostream.h" is not a standard C++ header. Some compilers provide it for legacy support, but you should always use just "iostream" instead. The main difference between the legacy and the standard one is the std namespace. To have a compliant version of your example, it would look like this:

#include <iostream>
using namespace std; // import the contents of the std namespace
                     // into the global namespace

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