视觉c++涡轮增压 c++
您好,我已经用 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
几年前,当 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 typebool
(was typically emulated by a macro 'BOOL'). When I remember correctly, it was just a 16 bit compiler, what gives you additional "fun" withint
and pointer arithmetik.Happy porting ;-)
您可以尝试这些丑陋的黑客:
等等,但请考虑使用更新的编译器,例如 GCC 或 MSVC。
You could try these ugly hacks:
and so on, but instead, consider using a more recent compiler, such as GCC or MSVC.
如果您确实需要在 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.
如果您需要为 DOS 构建程序,您可以尝试 Borland C++ 5.02。
它是最后一个支持 DOS 的 Borland 编译器,并包含一些预标准的 STL。
像这样的代码:
应该可以与之编译。
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:
should be compilable with it.