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

Jul 17, 2013 at 11:46pm

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

Hello,

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.

#256343
Jul 18, 2013 at 10:58pm

Nevermind :)

#256430
Jul 19, 2013 at 6:55am

Hi,

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)

Cheers

#256462
Jul 31, 2013 at 8:14pm

Thx Pierre, solved my problem too :)

#257744

You must be logged in to reply to this topic.