3

I have a pressing need to develop an application for Windows 98, and do not have the option of using a different operating system. In this day and age, is there any modern SDK that I can use to develop the application? What would be awesome, is if there was some way to target Windows 98 from Visual Studio 2015 but as far as I know there is no way of doing this.

Can I write and compile an application for Windows 98 using Visual Studio 2015? If not, then what is my next best option?

Snoop
  • 1,046
  • 1
  • 13
  • 33

1 Answers1

1

I assume you are writing native code: Windows 98 uses the Win32-API, like XP and modern Windows versions too. Some things are different, e.g. APIs like VirtualAllocEx() are missing. If you avoid these APIs (https://msdn.microsoft.com has a minimum requirements section for each API) and write native code, your program should run on Windows 98 too. If you have problems with Visual Studio, you can use good old gcc and an IDE like Eclipse, Code::Blocks, etc. Just make sure you don't compile it for the 64-bit plattform. Otherwise you will get a PE+ binary which won't run on Windows 98.

EDIT:

According to the discussion in the comment sections a few updates: Although a PE for 32-Bit (compiled on a modern Windows box) is compatible to Windows 98, there might be problems with Visual Studio due to its runtime library. As an alternative, you could try to

  • compile without runtime
  • use MingW as it uses msvcrt.dll

Nevertheless, it is still tricky to check which Windows version supports certain APIs due to updates in the MSDN. An older copy of the MSDN could help at this point.

Christian Ammann
  • 888
  • 8
  • 19
  • 1
    It isn't really quite that simple. Executables built with the VS2015 default settings won't even run on Windows XP, never mind Windows 98. (I'm not actually sure why, different version of the PE format or something?) – Harry Johnston Jul 09 '16 at 04:21
  • There are two major versions, PE and PE+. The latter one is 64-Bit. I haven't tried using Visual Studio, but a PE executable, compiled with MinGW, which uses supported Win32 APIs should run on Win98. I am not sure about the automatically generated stub (e.g. exception handler), but an older version of mingw could help in this case. I don't see the point, why I get a downvote here. – Christian Ammann Jul 09 '16 at 08:55
  • Hmmm. According to [this blog post](https://blogs.msdn.microsoft.com/vcblog/2012/06/15/targeting-windows-xp-with-c-in-visual-studio-2012/) the only reason executables built with the default VS2012 settings don't work on XP is that the runtime uses newer APIs. Perhaps I was misled by the error message, "Is not a valid Win32 application". MinGW probably won't have that problem, because it uses msvcrt.dll rather than having its own runtime. – Harry Johnston Jul 09 '16 at 22:29
  • (Not my downvote, but your answer reads like it is missing the point. The OP probably already knows that he has to stick to the APIs available in Windows 98, for example. It might be a good idea to edit to focus on the very sound suggestion of using MinGW, including an explanation of why that is likely to work, i.e., because it uses the built-in msvcrt.dll.) – Harry Johnston Jul 09 '16 at 23:01
  • Incidentally, MSDN won't help unless you can get hold of a sufficiently old copy - the online version doesn't keep information about old versions of Windows indefinitely. There are lots of APIs that have actually been around forever whose online documentation says that the minimum supported OS is Vista. (Which is [technically correct](https://www.youtube.com/watch?v=hou0lU8WMgo) I suppose since earlier OSes aren't supported *at all*.) – Harry Johnston Jul 09 '16 at 23:03
  • 1
    @HarryJohnston Oh ok that's interesting. I did not know I can not trust the MSDN minimum Windows version requirements. – Christian Ammann Jul 09 '16 at 23:38
  • Yes, it caught me by surprise too. The Internet Archive's wayback machine can be useful in this respect. I've never tried using it to get MSDN information from *quite* that far back, but theoretically it should be available - according to Wikipeda, they started archiving the web as early as 1996. – Harry Johnston Jul 09 '16 at 23:56