Cannot compile a simple Qt program in MT mode as opposed to MD in Visual Studio 2010

后端 未结 3 1937
暗喜
暗喜 2020-12-31 11:32

I\'m trying to compile using MTd in Visual Studio 2010 instead of MDd (so that the dll\'s are packaged in and i won\'t need to distribute them with my exe), but I keep getti

3条回答
  •  佛祖请我去吃肉
    2020-12-31 11:36

    This is a standard linker error when you tinker with /MT. You are now linking some code that was compiled with /MT and thus has a dependency on the CRT code in libcmt.lib with some code that was compiled with /MD and thus has a dependency on the CRT code in msvcrt.lib. This is not allowed, there can be only one CRT linked into your program.

    You'll need to find the code that is still compiled with /MD. This code may well exist in a .lib, like the runtime support code for QT. If QT doesn't have a .lib that supports statically linking the CRT then you're stuck with /MD. That's not uncommon, writing code that lives in DLLs that can deal with /MT is difficult.

提交回复
热议问题