Linker: "__fltused" is multiply defined if I don't use a float in the program

Viewed 332

The full output is this (just one error), and release builds don't seem to encounter the same problem

SDL2.lib(SDL_stdlib.obj) : error LNK2005: __fltused already defined in LIBCMTD.lib(fltused.obj)`

I've recompiled SDL2.lib with /MTd and as a static library, and ensured it was the only library of it's name on my system.

it gets bizarre though: Putting a floating point operation anywhere in my program allows it to link without problems:

int main(int argc, char * argv[]) {
    return 0;  // will not link
}

int main(int argc, char * argv[]) {
    float flt = 0.0f; // gets around optimization
    return int(flt); // will link
}

That's not ideal of course, what could be the underlying issue here?

2 Answers
Related