C++ program compatible with Windows 95

7.1k Views Asked by At

I made the mistake of thinking that the C++ program that I coded with VS 2012 would work on a computer running 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.

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?

Edit : After no suitable answer.

I don't mind having to build a different .exe for different Windows versions.

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.

3

There are 3 best solutions below

2
On BEST ANSWER

First of all, why Windows 95? Well, anyway, you can use MinGW for that. Code::Blocks is my favorite IDE that's got MinGW. You can download it from here.

0
On

Download and install Pelles C v12. Break free of runtime dependencies and incompatibilities. Just be aware of the APIs you are calling and the supported releases of Windows for said APIs. I would never consult Visual Studio for this lol

3
On

You need Visual C++ 2005 Express or Pro! It's the last version that'll support 95/98/ME. Anything newer will compile executables forcibly restricted to Windows XP-SP2 or above platforms.

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 (e.g. CreateFileA, ReadFile, CloseFile, etc.). I suppose if you code in ANSI "C" and use basic stuff you'll be OK, but it just depends.

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.