简体   繁体   English

与Windows 95兼容的C ++程序

[英]C++ program compatible with Windows 95

I made the mistake of thinking that the C++ program that I coded with VS 2012 would work on a computer running windows 95. 我错误地认为我使用VS 2012编写的C ++程序可以在运行Windows 95的计算机上运行。

Now I know why it doesn't work. 现在我知道为什么它不起作用。 So I took a look at other free compilers such as Dev-C++ 5 but after going through the forum of the Dev-C++ web site, it seems that it also can't be used make Windows 95 compatible applications. 所以我看了一下其他免费的编译器,比如Dev-C ++ 5,但是经过Dev-C ++网站的论坛后,它似乎也无法用于制作与Windows 95兼容的应用程序。

So my question is, what should I use to compile my C++ application in order for it to work on Windows 95 and all the other versions of windows from 95 to 8? 所以我的问题是,我应该使用什么来编译我的C ++应用程序,以便它可以在Windows 95和95到8的所有其他版本的Windows上运行?

Edit : After no suitable answer. 编辑:没有合适的答案。

I don't mind having to build a different .exe for different Windows versions. 我不介意为不同的Windows版本构建不同的.exe。

Edit : Problem solved! 编辑:问题解决了!

Thanks to everyone who help in this discussion. 感谢所有在此讨论中提供帮助的人。

Using MingW and code blocks it took me only 20 minutes to adapt the code to Win 95 friendly libraries... and a full day to install Win 95 in a VM lol. 使用MingW和代码块我只需要20分钟就可以将代码调整到Win 95友好库......并且需要一整天才能在VM中安装Win 95。

First of all, why Windows 95? 首先,为什么Windows 95? Well, anyway, you can use MinGW for that. 好吧,无论如何,你可以使用MinGW。 Code::Blocks is my favorite IDE that's got MinGW. Code :: Blocks是我最喜欢的拥有MinGW的IDE。 You can download it from here . 你可以从这里下载。

You need Visual C++ 2005 Express or Pro! 您需要Visual C ++ 2005 Express或Pro! It's the last version that'll support 95/98/ME. 这是支持95/98 / ME的最后一个版本。 Anything newer will compile executables forcibly restricted to Windows XP-SP2 or above platforms. 任何更新的东西都会编译强制限制在Windows XP-SP2或更高版本平台上的可执行文件。

You also have to mind the WinAPIs that you call as there are less of them available in 95, so you want to check with the MSDN library on everything you use to see if it's an original API that was available from day one (eg CreateFileA, ReadFile, CloseFile, etc.). 您还必须记住您调用的WinAPI,因为95中可用的WinAPI较少,因此您需要查看MSDN库中的所有内容,以查看它是否是从第一天开始可用的原始API(例如CreateFileA, ReadFile,CloseFile等)。 I suppose if you code in ANSI "C" and use basic stuff you'll be OK, but it just depends. 我想如果你用ANSI“C”编码并使用基本的东西你就可以了,但这只是取决于。

FYI, the final MSDN library to complement a 2005 Visual Studio installation is "Microsoft Visual Studio 2005 (April 2007 Edition)" - you can find an ISO for that if you look, and Express was always free, just limited by the exclusion of a full graphical resource editor and other things. 仅供参考的2005年Visual Studio安装的最终MSDN库是“Microsoft Visual Studio 2005(2007年4月版)” - 如果你看的话你可以找到一个ISO,并且Express总是免费的,仅限于排除完整的图形资源编辑器和其他东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM