Forums > Dev

error building Windows External (LNK2005:) LIBCMTD.lib (sprintf.obj)

Jul 17 2013 | 11:46 pm


I’m running into an error building a Windows external with SDK 6.1.1–worked fine with SDK 5.

When I build, I get the error "error LNK2005: _sprintf already defined in MaxAPI.lib(MaxAPI.dll) C:\Users\Administrator\Desktop\MaxSDK-6.1.1\examples\advanced\my_object_name\LIBCMTD.lib(sprintf.obj)"

I’m defining anywhere in my code. It seems like it’s being defined in the MaxAPI.dll and also the LIBCMTD.lib, but I have no idea what/where that is. I’ve searched for the file and searched hidden as well as sprintf.obj, but I can’t find it.

Any insight would be great lest I decide to release the 64-bit version of this object as "Mac only" :) Thanks.

Jul 18 2013 | 10:58 pm

Nevermind :)

Jul 19 2013 | 6:55 am


You should ignore the default library libcmt.lib and perhaps msvcrt.lib too. For Visual Studio, try this :
– project properties -> Linker -> Ignore all default libraries : no
– project properties -> Linker -> Ignore specific library : libcmt.lib; msvcrt.lib;
– project properties -> C/C++ -> Runtime libary : Multithread (/MT)


Jul 31 2013 | 8:14 pm

Thx Pierre, solved my problem too :)

Aug 14 2015 | 9:09 am

An alternative is try /MT but don’t ignore the libraries libcmt and mscvrt. for debug option, use /MDd for now (at least I couldn’t get /MTd working without it messing sprintf).

Viewing 5 posts - 1 through 5 (of 5 total)

Forums > Dev