视觉c++涡轮增压 c++

发布于 2024-12-03 08:08:10 字数 583 浏览 4 评论 0原文

您好,我已经用 Visual C++ 编写了一个程序,无论出于何种原因,现在我需要在 Turbo C++ 3.0 中运行/编译这个相同的程序。

我已设法从某些来源获得编译器,但当我尝试编译代码时出现很多错误。我已经注释掉了“#include stdafx.h”,为IDE中的目录和库设置了适当的路径。这些是给我错误的行

#include <list> //Error unable to open include file list

using namespace std; //Declaration syntax error

typedef list<int> itemist; // , expected

bool setPlayerChar(char key); // Type name expected // Declaration missing ;

void generateItemList(piece market[9], itemlist &ilist) // ) expected

bool exit = false; // Undefined symbol 'bool' // statement missing ;

Hi I have written a program in visual c++ and for whatever reason now i need to run/compile this same program in turbo c++ 3.0.

I have managed to get the compiler from some source but I get a lot of errors when i try to compile my code. I have commented out "#include stdafx.h" set the appropriate paths for the directories and libraries in the ide. these are the lines that give me errors

#include <list> //Error unable to open include file list

using namespace std; //Declaration syntax error

typedef list<int> itemist; // , expected

bool setPlayerChar(char key); // Type name expected // Declaration missing ;

void generateItemList(piece market[9], itemlist &ilist) // ) expected

bool exit = false; // Undefined symbol 'bool' // statement missing ;

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

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

发布评论

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

评论(4

不美如何 2024-12-10 08:08:10

几年前,当 Turbo C++ 3.0 还是最先进的时,今天的许多 C++ 东西还不存在。没有 STL,没有 ,没有命名空间,甚至没有类型 bool(通常由宏“BOOL”模拟)。当我没记错时,它只是一个 16 位编译器,它为您提供了 int 和指针算术的额外“乐趣”。

快乐移植;-)

When Turbo C++ 3.0 was state-of-the-art several years ago, a lot of C++ things of today did not exist. No STL, no <list>, no namespaces, not even the type bool (was typically emulated by a macro 'BOOL'). When I remember correctly, it was just a 16 bit compiler, what gives you additional "fun" with int and pointer arithmetik.

Happy porting ;-)

时光暖心i 2024-12-10 08:08:10

您可以尝试这些丑陋的黑客:

/* Check if the compiler is Borland Turbo C++ 3.0 or earlier */
#ifdef __BORLANDC__
#if (__BORLANDC__ <= 0x400)

#include <list.h>

typedef int bool;
#define true  (1)
#define false (0)

#else

#include <list>

#endif

等等,但请考虑使用更新的编译器,例如 GCC 或 MSVC。

You could try these ugly hacks:

/* Check if the compiler is Borland Turbo C++ 3.0 or earlier */
#ifdef __BORLANDC__
#if (__BORLANDC__ <= 0x400)

#include <list.h>

typedef int bool;
#define true  (1)
#define false (0)

#else

#include <list>

#endif

and so on, but instead, consider using a more recent compiler, such as GCC or MSVC.

超可爱的懒熊 2024-12-10 08:08:10

如果您确实需要在 DOS 中运行应用程序并且机器至少为 80386,我建议使用 DJGPP。它提供了最近的 GCC。然后您的应用程序将在 x86 保护模式下运行。

If you really need to run your application in DOS and the machine is at least 80386, I would suggest using DJGPP. It provides recent GCC. Your application will then run in x86 protected mode.

夕色琉璃 2024-12-10 08:08:10

如果您需要为 DOS 构建程序,您可以尝试 Borland C++ 5.02。
它是最后一个支持 DOS 的 Borland 编译器,并包含一些预标准的 STL。

像这样的代码:

#include <list>

using namespace std;

typedef list<int> itemist;

应该可以与之编译。

If you need to build your program for DOS, you may try Borland C++ 5.02.
It is the last Borland's compiler that supported DOS, and included some pre-standard STL.

Code like this:

#include <list>

using namespace std;

typedef list<int> itemist;

should be compilable with it.

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