Skip to main content
GameDev.net gamedev.net
🔒 Locked

Different runtime in different DLLs?

Started by conman Aug 16, 2006 at 2:10 AM 3 replies 850+ views
Original Post
conman
conman
Hi folks, on a windows system: does anyone know if it is a problem to use different runtimes (for example 'Multithread DLL Debug' and 'Multithread DLL') in different DLLs if this DLLs later should work together? I guess I'll get a linker warning because of the conflicting libraries, when I link the dependent DLL. I can ignore this warning, but I am not sure if that's an bad idea... Any ideas? Thanks, Constantin
Paulius Maruska
Paulius Maruska
Well, in general, you should avoid such situations. However, if you do not allocate any resources in one dll and then free them in a different dll, you should be fine with the different runtimes too.

Oh, and i should note, that the linker won't generate any warnings.
conman
conman
Thanks Paulius, but are you sure? I get a

WARNING LNK4098: defaultlib 'LIBC' conflicts with use of other libs; use /NODEFAULTLIB:library


and I thought that's because when I link the dependent DLL I reference the .lib of the independent DLL and that's where the linker sees the different CRTs...

Am I wrong here?
Paulius Maruska
Paulius Maruska
Quote:
Original post by conman
Thanks Paulius, but are you sure? I get a

WARNING LNK4098: defaultlib 'LIBC' conflicts with use of other libs; use /NODEFAULTLIB:library


and I thought that's because when I link the dependent DLL I reference the .lib of the independent DLL and that's where the linker sees the different CRTs...

Am I wrong here?


Not exactly. Read the note on this page. It seems you are trying to link more than one CRT version to a single executable (dll or exe). You are probably compiling your source files with different /MT[d] /MD[d] option.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.