LNK2005: _iswdigit already defined in ...

I’m in the process of preparing a release for a client. I’ve done the work, the tests pass, the stress test runs with flying colours and so I’ve tagged the source and I’m in the middle of the final build and test cycle. It’s a nice feeling.

One of the last things I do when shipping code is to turn off the default STLPort support that I use when I’m developing. I edit one header file and the whole codebase switches from using STLPort to using the STL that ships with whatever version of VC you happen to be using. Today I had a surprising error pop up when I rebuilt after switching back to the “normal” STL.

“error LNK2005: _iswdigit already defined in CalculateCheckDigit.obj”

A quick google and I found a nice description of the problem and some solutions, here, over at Steve Friedl’s blog, UnixWiz.net.

Thanks Steve!