Targeting OS/2 with Visual Studio 2003

Sydney’s idea of what Visual C++ for OS/2 should look like

No, it’s not a typo.

This is a long-winded post, but the short version is that I found a working combination to get the C compiler from Visual Studio 2003 targeting OS/2.

Once I’d learned how C compilers are a collection of programs working in concert, I’d always wanted to force Microsoft C to work in that fashion, however it is born to be a compiler that integrates everything but linking. There has been a “/Fa” or output assembly option, but I’ve never gotten it to do anything useful. I’m not that much into assembly but it seemed insurmountable.

But for some reason this time things were different.

This time I used:

Microsoft (R) Macro Assembler Version 6.11

After the great divorce and the rise of Windows NT, Microsoft had shifted from the OMF format to COFF. However somewhere buried in their old tools it still supports it, namely MASM. For example, if I try to run LINK386 (the OS/2 Linker) against output from Visual C++ 2003 I get his

abandon.obj :  fatal error L1101: invalid object module
 Object file offset: 1  Record type: 4c

However if I output to assembly and then have MASM assemble that, and try the linker, I’m bombarded with errors like this:

warp.obj(warp.asm) :  error L2025: __real@4059000000000000 : symbol defined more than once
warp.obj(warp.asm) :  error L2029: '__ftol2' : unresolved external

If I was smart I’d have given up, there is pages and pages of this stuff. But I’m not smart, so instead I decided to something different, and use SED, the stream editor, and try to patch out the errors.

The ftol2 call is for newer CPU’s and any OS/2 library won’t have it. But instead of binary editing symbols we can replace the ftol2 with ftol with this simple line:

 sed -e 's/_ftol2/_ftol/g'

For some reason Visual C++ likes to make all it’s reals “public” meaning there can only be one, but yet there is so many. Why not comment them all out?

sed -e 's/PUBLIC\t__real@/;PUBLIC\t__real@/g'

And there are various other annoying things, but again they can be all patched out. Just as the older Windows 1991 Pre-release compilers also have weird syntax that MASM doesn’t understand.

astro.asm(59): error A2138: invalid data initializer

which goes into how Microsoft C used to initialize floating point constants:

CONST   SEGMENT  DWORD USE32 PUBLIC 'CONST'
$T20000         DQ      0a0ce51293ee845c8r    ; 1.157407407407407E-05
$T20001         DQ      0bffffd3441429ec5r    ; 2440587.499999667
CONST      ENDS

while I found that the C compiler in Xenix 386 initialises them like this:

$T20000         DQ      0a0ce51293ee845c8h    ; 1.157407407407407E-05
$T20001         DQ      0bffffd3441429ec5h    ; 2440587.499999667

This one was a little hard for me as I’m not a sed expert, but I did figure out how to mark the section, and then to replace it

sed -e "s/DQ\t[0-9a-f]r/&XMMMMMMX/g" $.a1 |  sed -e "s/rXMMMMMMX/H/g"

And so on. At the moment my ‘mangle’ script is now this:

.c.obj:
        $(CC) $(INC) $(OPT) $(DEBUG) /c /Fa$*.a $*.c
        wsl sed -e 's/FLAT://g' $*.a > $*.a1
        wsl sed -e "s/DQ\t[0-9a-f]*r/&XMMMMMMX/g" $*.a1 \
        | wsl sed -e "s/rXMMMMMMX/H/g" \
        | wsl sed -e 's/call \t\[/call DWORD PTR\[/g' \
        | wsl sed -e 's/PUBLIC\t__real@/;PUBLIC\t__real@/g' \
        | wsl sed -e 's/_ftol2/_ftol/g' > $*.asm
        ml /c $*.asm
        del $*.a $*.a1 $*.asm

This allows me to plug it into a Makefile, so I only have to edit it in one place.

Not surprisingly, this allows the LINK from Visual C++ 1.0 to link the MASM generated object files and get a native Win32 executable. Even from the oldest compiler I have from the Microsoft OS/2 2.00 Beta 2 SDK from 1989!

But now that we have the C compilers being able to output to something we can edit and force into a Win32, there is a few more things and suddenly:

        C:\cl386-research\bin\13.10.6030\cl386 /u /w /G3 /O  /c /Faphoon.a phoon.c
C:\cl386-research\bin\13.10.6030\CL386.EXE: warning: invoking C:\cl386-research\bin\13.10.6030\CL.EXE
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.6030 for 80x86
Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.

phoon.c
        wsl sed -e 's/FLAT://g' phoon.a > phoon.a1
        wsl sed -e "s/DQ\t[0-9a-f]*r/&XMMMMMMX/g" phoon.a1  | wsl sed -e "s/rXMMMMMMX/H/g"  | wsl sed -e 's/call \t\[/call DWORD PTR\[/g'  | wsl sed -e 's/PUBLIC\t__real@/;PUBLIC\t__real@/g'  | wsl sed -e 's/_ftol2/_ftol/g' > phoon.asm
        ml /c phoon.asm
Microsoft (R) Macro Assembler Version 6.11
Copyright (C) Microsoft Corp 1981-1993.  All rights reserved.

 Assembling: phoon.asm
        del phoon.a phoon.a1 phoon.asm
        msdos286 run286 C:\cl386-research\bin\ddk12\LINK386.EXE @phoon.lnk

Operating System/2 Linear Executable Linker
Version 2.01.012 Nov 02 1993
Copyright (C) IBM Corporation 1988-1993.
Copyright (C) Microsoft Corp. 1988-1993.
 All rights reserved.

Object Modules [.obj]: astro.obj date_p.obj phoon.obj
Run File [astro.exe]: phoon2 /NOE /NOI /NOD:OLDNAMES
List File [nul.map]: nul.map
Libraries [.lib]: ..\..\lib2\libc.lib +
Libraries [.lib]: ..\..\lib2\os2386.lib
Definitions File [nul.def]: nul.def;
LINK386 :  warning L4071: application type not specified; assuming WINDOWCOMPAT

I know it’s a bit of a word salad, but the key thing here is that using Visual C++ 2003’s compiler (version 13.10.6030), and outputting to assembly that we can edit, we can then use MASM to build objects that surprisingly LINK386 version 2.01.012 will link with. I suspect this has to do with device drivers, and probably the majority of the OS/2 operating system.

Anways, we’ve done the incredible, using the same object files, we made both a Win32 application, and an OS/2 application!

phoon-13.10.6030.exe: PE32 executable (console) Intel 80386, for MS Windows
phoon2.exe: MS-DOS executable, LX for OS/2 (console) i80386
Phoon compiled by Visual C++ 2003 on OS/2 2.00

Incidentally Happy CNY!

Obviously, this is VERY cool stuff.

I know the next question is do we have to rely on a 16bit linker? How about Watcom?

C:\cl386-research\proj\trek>wlink @trek.wlk
WATCOM Linker Version 10.0
Copyright by WATCOM International Corp. 1985, 1994. All rights reserved.
WATCOM is a trademark of WATCOM International Corp.
loading object files
searching libraries
Warning(1008): cannot open LIBC.lib : No such file or directory
Warning(1008): cannot open OLDNAMES.lib : No such file or directory
creating an OS/2 32-bit executable

Ignore the warnings and YES we can Link from something much newer & 32bit! In this example I linked the old TREK game, also built with Visual C++ 2003. The response file looks lke:

SYS os2v2
NAME trek2w
FILE abandon.obj,attack.obj,autover.obj,capture.obj,cgetc.obj,checkcond.obj
FILE check_out.obj,compkl.obj,computer.obj,damage.obj,damaged.obj,dcrept.obj
FILE destruct.obj,dock.obj,dumpgame.obj,dumpme.obj,dumpssradio.obj,events.obj
FILE externs.obj,getcodi.obj,getpar.obj,help.obj,impulse.obj,initquad.obj
FILE kill.obj,klmove.obj,lose.obj,lrscan.obj,main.OBJ,move.obj
FILE nova.obj,nullsleep.obj,out.obj,phaser.obj,play.obj,ram.obj
FILE ranf.obj,rest.obj,schedule.obj,score.obj,setup.obj,setwarp.obj
FILE shield.obj,snova.obj,srscan.obj,systemname.obj,torped.obj,utility.obj
FILE visual.obj,warp.obj,win.obj
LIBR ..\..\lib2\LIBC.LIB
LIBR ..\..\lib2\OS2386.LIB

It’s probably needing additional stack space, maybe some other stuff, or resources, maybe how to flag it’s windowing compatible.

TREK built by Visual C++ 2003, and Linked using Watcom C/C++ 10.0

How do I get started, if I dare?! First download and unpack cl386-research-v2. Ideally on the root of your C: drive, because why not?

run the ‘env’ command to set your environment up. Its pretty complicated but in the proj directly there is currently:

*NOTE that I do use SED scripts, I have it set to use Linux in the WSL package.
I tried some Win32 sed but it didn’t work. So you need WSL or a working sed!

you can then go into each directory and run

make os2

and it’ll compile populate a floppy and launch the emulator

Its all good fun.

Read the Makefiles to configure a compiler, how to run it, and if you need to mangle the assembly. The 32bit new stuff needs to be mangled, the older stuff almost always works with just compile.

# Version 6.00.054      1989
# https://archive.org/details/os-2-cd-rom_202401
PLATFORM = ddksrc

In this case it’ll select the platform from the ‘ddksdk’ release. The next is if the compiler is OS/2 based or native win32. Basically 73g / windows 95 & below are native Win32.

In the above example we comment out the dos extended cross

# dos exteded cross
CC =  $(EMU) $(DOSX) $(CL386ROOT)\$(PLATFORM)\cl386
# native CC
# CC =  $(CL386ROOT)\$(PLATFORM)\cl386

Next is the mangle strategy. In this case it’s an ancient OS/2 (like) compile so
try un commenting the ‘just compile’ line

# must include ONLY ONE strategey..
# for OS/2 it must have been assembled my MASM 6.11

include ..\-justcompile.mak
#include ..\-mangleassembly.mak
#include ..\-plainassembly.mak

save the makefile, and run

nmake os2

You can just close the emulator as after each run it’ll unpack a hard disk image, so nothing will be lost. or saved. It’s just for testing. You may need to periodically clean the floppy drive, as that is the only way to transfer stuff in and out of the VM.

What versions of CL386 have I found? Well, it’s quite a few, although I know I’m missing quite a few.

== c386 ============================
Microsoft C 5 386 Compiler

Microsoft C 5.2 286/386 Compiler -- Driver

@(#)C Compiler Apr 19 1990 11:48:30

Copyright (c) Microsoft Corp
1984-1989. All rights reserved.
  (press <return> to continue)
Microsoft 386 C Compiler. Version 1.00.075
Quick C Compiler Version 2.00.000
1.00.075

== ddk12 ============================

C 6.00 (Alpha) Aug 24 1990 19:12:31

Copyright (c) Microsoft Corp
1984-1989. All rights reserved.
  (press <return> to continue)
Microsoft 386 C Compiler. Version 6.00.054
Quick C Compiler Version 2.00.000
6.00.054

== ddk20 ============================

C 6.00 (Alpha) Aug 16 1990 23:04:06

Copyright (c) Microsoft Corp
1984-1989. All rights reserved.
  (press <return> to continue)
Microsoft 386 C Compiler. Version 6.00.054
Quick C Compiler Version 2.00.000
6.00.054

== ddksrc ============================

C 6.00 (Alpha) Aug 24 1990 19:21:49

Copyright (c) Microsoft Corp
1984-1989. All rights reserved.
  (press <return> to continue)
Microsoft 386 C Compiler. Version 6.00.054
Quick C Compiler Version 2.00.000
6.00.054

== nt-sep ============================

@(#)C Compiler 6.00 Feb 06 1991 17:15:19
@(#)C Compiler 6.00 May 13 1991 23:54:12
@(#)C Compiler 6.00 Jun 03 1991 15:16:22


Copyright (c) Microsoft Corp
1984-1991. All rights reserved.
  (press <return> to continue)
Microsoft 386 C Compiler. Version 6.00.077
Quick C Compiler Version 2.00.000
6.00.077

== nt-oct ============================

@(#)C Compiler 6.00 Jun 03 1991 15:16:22
@(#)C Compiler 6.00 Jun 13 1991 22:07:23
@(#)C Compiler 6.00 Oct 10 1991 00:42:24

Copyright (c) Microsoft Corp
1984-1991. All rights reserved.
  (press <return> to continue)
Microsoft 386 C Compiler. Version 6.00.080
Quick C Compiler Version 2.00.000
6.00.080

== nt-dec ============================
@(#)C Compiler 6.00 Jun 03 1991 15:16:22
@(#)C Compiler 6.00 Jun 13 1991 22:07:23
@(#)C Compiler 6.00 Oct 10 1991 00:42:24

Copyright (c) Microsoft Corp
1984-1991. All rights reserved.
  (press <return> to continue)
Microsoft 386 C Compiler. Version 6.00.081
Quick C Compiler Version 2.00.000
6.00.081

== 73g  ============================
1984-1993. All rights reserved.
Copyright (c) Microsoft Corp
8.00.3200
32-bit C/C++ Optimizing Compiler Version
Microsoft (R)


== msvc32s ============================

Microsoft 8.00.0000 - Copyright (C) 1986-1993 Microsoft Corp.
Microsoft 8.00.0000 - Copyright (C) 1986-1993 Microsoft Corp.
@(#) Microsoft C/C++ 32 bits x86 Compiler Version 8.00.XXXX

8.00.000

== 13.10.6030 ============================

Microsoft (R) C/C++ Compiler Version 13.10.6030
From my install of Visual Studio 2003 Enterprise

As you can see many of these earlier OS/2 compilers report the same versions but are in fact different builds on the inside. I suspect Microsoft had to support one version, and an Alpha version of version 6 is as good as it got. I would have imagined there were internal 32bit versions of 6 or 7, but I haven’t seen them.

Compiling and running TREK

Hopefully this gives some idea of how I tried to made a probably too modular build system to try all kinds of different compilers. I might have to see if it’s possible to run the tools from the 1992 versions of Windows NT in this setup, perhaps they are interesting as well.

One thing in my porting GCC to OS/2 experience is that the usability of the C compilers from 1991 were dramatically better than what Microsoft had given IBM at the time of the divorce. No doubt the upcoming NTOS/2 project was placing a bigger demand on the tools team.

If anyone has any access to other ‘cl386’ compilers, or early OS/2 2.00 stuff, please let me know! I’d love to do build/tests and see if my idea of distributing objects ‘just works’!

When 0 is greater than 1.0

I came across this fun thing debugging a QuakeWorld client on a RISC machine. I think something is failing as I’m using terminal server. For some reason width is being passed as 0. Not sure why I didn’t debug it enough to care, so I setup a quick block to only evaluate the Fov if the calculated x was greater than 1.0

And Microsoft C did not disappoint.

I think it may have been some incremental linking issue? I’m not sure I purged the build directory and re-ran make and didn’t experience the crash again. I had to get the screenshot or even I wouldn’t believe it.

In the end I got it running:

Of course among the eagle eyed you may notice this is version 13.00.8499 of the compiler. But the last compiler for the Dec Alpha / Windows NT was version 12…

More on that later!

GNU Chess ’87

I am not much of a chess player. That said one thing that has annoyed me to no end is GNU Chess 1.2. Over on bitsavers is this fun directory:

And despite being a treasure trove of ancient GNU software, I have never been able to get GNU Chess to do much of anything. At best it’ll give the Chess prompt, and then it’ll either crash (good!) or worst case it just exits silently with no reason given.

I have put only minimal effort into debugging it, and really got nowhere. I don’t know why this is such a tough beast to deal with, or why I even care. As I mentioned above, I’m not much of a chess player.

But for some reason this time around I thought I’d try the earliest release quality Visual C++ to build it. I wasn’t expecting much, however for some reason this ancient version seems to run.

I had to enable a few things such as the RANDOM & HASH to make it look like it wants to play. I ended up having to make some changes after a draw or victory as the ‘self playing mode’would keep going. Not sure what’s going on there, and I added a line at the end of the logic loop to always print the board, so at least you can see what is going on if you have it playing itself.

With that said this is the most ridiculous thing I’ve seen:

  White Black Depth  Nodes  Score    Cpu     Rate
1. e2e4 e7e5      4   5793      0   0.00      1
2. d2d4 b8c6      4      0      0   0.00      0
3. d4e5 c6e5      4  17966      0   0.00      1
4. g1f3 b7b6      4      0      0   0.00      0
5. f3e5 f8c5      4 487931   -325   0.00      1
6. d1d5 c5b4      4 2079943   -425   1.00      2079943
7. e1d1 a7a6      4      0    775   0.00      0
8. d5f7           4 161840   4525   0.00      1
Averages:  4.00 ply, 550695 nodes,  0.20 cpu, 2753473 nodes/sec

Given I don’t have any good rusage emulation going on (I know its in MinGW at some point, and I probably can find it, and get it running on MSVC but I don’t see that as important) an 8 move victory seems pretty… unlikely?

Maybe it’s a good test of other C compilers to see if they produce anything. Or maybe it’s all a red herring? I haven’t tested with much but GCC 1.40 can’t even run it on x86. Watcom 10 can build, but it crashes during a self game.

It’s one of those mysteries, that I’m sure there is some fundamental lesson, but I’m not sure what it is.

Other than it’s a long way down, standing on the shoulders of giants.

I put the source & exe over on github. Not that I expect any takers.

oneAPI Base Toolkit from Intel [free as in beer]

I’ve been informed that the toolkit includes some fancy memory tools to detect incorrect access types when you use void pointers for fun and profit, but accidentally copy in too much ( or little ) and can really mess stuff up. Just because of alignment and it ‘fits’ doesn’t mean you are doing what you think you are doing!

Anyways, link is here!

The intel toolkit is expected to integrate with Visual Studio 2017 or 2019. I have the ‘community version’ and it picked it up fine. In addition 2019 has ASAN which also helps combat the infamous memory issues of C/C++

<need quote from [HCI]Mara’akate…>

With the win being the profiling tools, and the memory leak tool. I just haven’t had time lately, I’ve been busy IRL, and wanting to wrap up some a.out to OMF adventures.

Windows Dev VM

(This is a guest post from Antoni Sawicki aka Tenox)

I have been living under a rock for several years now when it comes to Windows development. Recently wanting to do some maintenance on couple of my projects I needed to download Visual Studio and Windows SDK. Poking around the download page I have discovered that Microsoft now provides a fully pre-installed VMs with Visual Studio, SDK etc. for VMware, Hyper-V, VirtualBox and Parallels. That’s actually super cool and handy. Thank you Microsoft!

Looks like this has been available for 3 or 4 years now. Oh well.

Christmas came early!

Iv’e been in Japan the last 10 days, but upon my return to Hong Kong this little 9kg box was eagerly awaiting me!

I know that ‘unboxing’ donation videos are quite popular, but I thought I’d do the blog equivalent. I don’t want to ‘out’ the sender, although I did email them back a big THANKS, although I didn’t get a reply. Maybe it’s an email thing but I wanted to tell them THANKS again!

To start is a bunch of loose CD’s including old SDK’s, and the infamous Windows 2000 RC1 set including Dec Alpha builds of workstation & server. Also in there is Beta 3 of Windows 98! Cool!

In the box was also Back Office 45, Visual C++ 6.0, a sealed copy of Windows 2000 Server, Visual Studio 2005 Standard and Expression Studio 2.

I’ve always loved this, it’s NT 4.0 and all the good bits of 1997, like Exchange 5.5 & IIS 4.0! Also in there is a copy of Outlook 2000, so this is a much later build/packaging of Back Office 4.5 . I’ve always wondered how many if any Back Office purchasers ever used SNA Server. I’ve seen it something exclusively used in real enterprises that have site licenses anyways.

Visual C 6.0 is the last x86 compiler that was ‘pure’ before the .NET invasion. Although you can with a bit of work get 2003 and onward to build for strict Win32, but who wants to work? This is getting increasingly hard to find, and getting far more expensive. But it’s great to have this in retail in the box again! (I used to have this and Visual Studio 97/6.0).

It almost feels wrong to break the seal on this, although I’ll probably do an active directory deployment eventually now that I have machines running in the USA, Hong Kong, and Japan.

I’m super thankful for all of this, and if anyone else wants to send me their ‘old / obsolete junk’ drop me a line!

VC6 Ultimate updates

I’ve been trading emails with various people from the project after I had made my post, and helping them integrate more of Visual Studio 2003 into the project and working through a few issues to bring far better compatibility to VS 2003.

And the best part is being able to build projects in parallel!

10.2 seconds in parallel!

I haven’t ordered new processors, so the 2.1Ghz parts are… lacking. However being able to use all available cores makes building DOSBox pretty fast.

Restricting the build to a single process takes 1:13 while the full parallel build on this machine takes a mere 10 seconds!

So absolutely check out VC6Ultimate!

Visual Studio .net Enterprise Architect

I uh, also saw this on archive.org, which may help people looking for this stuff from the future as old tools get harder and harder to find. Especially bigger editions like the Enterprise Architect version.

VC6 Ultimate


I saw this the other day, VC6 Ultimate. It’s an interesting ‘update’ on the old Visual C++ 6.0 product with an improved UI, along with updated compiler toolchain taken from later versions of Visual C++. Naturally something like this is 1000000% unofficial.

Features include:

  • Portable and compatible with Win7 / Win10
    bye bye regedit, hello .hjson setting file !
    also meaning it should not mess with your current install
  • More compatible compiler
    multicore version of VC7.1 compiler (It’s fast)
    you can compile with other compilers (64bit), but not debug yet
  • Real-time highlighting and diagnostics
    based on libclang 6.0 and compatible with VisualAssistX
  • Real multicursor editing
    search, sort, number, evaluate, etc. while in multicursor mode
  • Improved UX and UI
    32bit icons, dark skin, lot of visual hints
    multi-monitor friendly
    revamped dialogs (project settings, threads, breakpoints, …)
    searchable command palette
  • It’s free (as in free beer)
    ever had to pay for a birthday present ? 😉
  • Every change has a toggle
    only take what you like, but we can not check each combination
  • It’s an internal spare time project
    don’t expect everything to work in every setup, but feel free to reach out

Included in the bundle is the following compilers:

  • clang version 3.8.0 (branches/release_38)
    Target: i686-pc-windows-msvc
  • Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.6030 for 80×86
    Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.
  • Microsoft (R) C/C++ Optimizing Compiler Version 14.00.40310.41 for AMD64
    Copyright (C) Microsoft Corporation. All rights reserved.

It’s an interesting project, although I tried to re-build some Visual C++ 2003 projects and it bombed out. Maybe it’s just more geared towards VC 6 as indicated.

You can download it here

https://gitlab.com/VC6Ultimate/VC6Ultimate

Platform SDK & DirectX for Visual C++ Express Edition 2005

Visual C++ 2005 Express Edition

So I’m back out, and on my limited machine (I did order something new, but on a group buying thing so it won’t be here for another SIX weeks… but then I’ll be on the road again so if I’m lucky 11 weeks……..) I’m using Visual C++ 2005 Express Edition, which by default includes just enough to compile simple stdio CLI based stuff.  To do anything more complicated you need what is known as the ‘Platform SDK’.  And to match up for the time period I’m using the Windows® Server 2003 SP1 Platform SDK Full Download. And of course various Direct X SDK’s too.

For my benefit (maybe yours too), here is

Instructions to integrate the Platform SDK are here, although I did set this to match the expected paths that were in my setup after installing service pack 1.  However I still had to manually do step 4:

Update the default.js file (found in %VSINSTALLDIR%\VC\VCWizards\AppWiz\Generic\Application\scripts\1033) and change the two lines that read:

LinkTool.AdditionalDependencies = “kernel32.lib $(NoInherit)”;

to:

// LinkTool.AdditionalDependencies = “kernel32.lib $(NoInherit)”;

And I was all set to go.

To make life easier (for me) this is headers & libs for the platform SDK + Direct X 6 & 7, and only 18 megabytes, instead of hundreds to download platform_directx6_7.7z  This has the directories and whatnot where they were expected, although you’ll have to manually add in the Direct X include & library directories, if you want to do anything with Direct X.

From the Tools menu in Visual Studio, select Options. The Options dialog box appears.

From the Options dialog box, expand the Projects and Solutions node and select VC++ Directories. In that section, add the following paths to the appropriate subsection:

unresolved symbol __imp____iob_func aka SDL 1.25 & Visual Studio 2015

While trying to build something with Visual C++ 2015 Community edition I got this fun error while trying to link:

LNK2019 unresolved external symbol __imp____iob_func referenced in function _ShowError
LNK2019 unresolved external symbol __imp__fprintf referenced in function _ShowError

So it turns out that some of the fundamental streams have changed, and when the SDL library is compiled it attaches LIBC into it, which then creates this fun mis-match.  The fix is easy, of course, just download the source to SDL 1.25, and re-build it with Visual Studio 2015.  But then you’ll get another error that /ZI and /Gy- are incompatible with eachother.  I just changed /ZI to the older /Z7 setting, and I could quickly compile SDL, copy the libs to my project and happily link & run.