WxWidgets应用程序生成错误Visual Studio 2019

sxissh06  于 2023-04-07  发布在  其他
关注(0)|答案(1)|浏览(154)

我用Visual Studio 2019构建了一个wxwidgets c++程序,在我的PC上没有问题,但是当我试图在另一台PC上启动它时,我得到了一个缺少库的消息。我搜索了互联网,并被建议将代码生成设置从DLLMultiThread(/ MD)更改为MultiThread(/ MT),我重新构建了该项目,并得到了几个错误消息,如:

**1> wxbase31u.lib (string.obj): error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' does not match 'MT_StaticRelease' in Window.obj**

**1> wxbase31u.lib (thread.obj): error LNK2038: mismatch found for 'RuntimeLibrary': value 'MD_DynamicRelease' does not match 'MT_StaticRelease' in Window.obj**

**1> wxbase31u.lib (list.obj): error LNK2038: mismatch found for 'RuntimeLibrary': value 'MD_DynamicRelease' does not match 'MT_StaticRelease' in Window.obj**

**1> wxbase31u.lib (appbase.obj): error LNK2038: mismatch found for 'RuntimeLibrary': value 'MD_DynamicRelease' does not match 'MT_StaticRelease' in Window.obj**

**1> wxbase31u.lib (time.obj): error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' does not match 'MT_StaticRelease' in Window.obj**

**1> wxbase31u.lib (hashmap.obj): error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' does not match value 'MT_StaticRelease' in Window.obj**

**1> wxbase31u.lib (object.obj): error LNK2038: found mismatch for 'RuntimeLibrary': value 'MD_DynamicRelease' does not match 'MT_StaticRelease' in Window.obj**

**1> wxbase31u.lib (strconv.obj): error LNK2038: mismatch found for 'RuntimeLibrary': value 'MD_DynamicRelease' does not match 'MT_StaticRelease' in Window.obj**

**1> wxbase31u.lib (log.obj): error LNK2038: mismatch found for 'RuntimeLibrary': value 'MD_DynamicRelease' does not match 'MT_StaticRelease' in Window.obj**

**1> wxbase31u.lib (event.obj): error LNK2038: mismatch found for 'RuntimeLibrary': value 'MD_DynamicRelease' does not match 'MT_StaticRelease' in Window.obj**

**1> wxbase31u.lib (stringimpl.obj): error LNK2038: mismatch found for 'RuntimeLibrary': value 'MD_DynamicRelease' does not match 'MT_StaticRelease' in Window.obj**

**1> wxbase31u.lib (strvararg.obj): error LNK2038: found mismatch for 'RuntimeLibrary': value 'MD_DynamicRelease' does not match value 'MT_StaticRelease' in Window.obj**

**1> wxbase31u.lib (unichar.obj): error LNK2038: mismatch found for 'RuntimeLibrary': value 'MD_DynamicRelease' does not match 'MT_StaticRelease' in Window.obj**

**1> wxbase31u.lib (stringops.obj): error LNK2038: mismatch found for 'RuntimeLibrary': value 'MD_DynamicRelease' does not match 'MT_StaticRelease' in Window.obj**

**1> wxbase31u.lib (intl.obj): error LNK2038: mismatch found for 'RuntimeLibrary': value 'MD_DynamicRelease' does not match 'MT_StaticRelease' in Window.obj**

**1> wxbase31u.lib (wxcrt.obj): error LNK2038: found mismatch for 'RuntimeLibrary': value 'MD_DynamicRelease' does not match value 'MT_StaticRelease' in Window.obj**

**1> wxbase31u.lib (xlocale.obj): error LNK2038: mismatch found for 'RuntimeLibrary': value 'MD_DynamicRelease' does not match 'MT_StaticRelease' in Window.obj**

**1> wxbase31u.lib (dummy.obj): error LNK2038: mismatch found for 'RuntimeLibrary': value 'MD_DynamicRelease' does not match 'MT_StaticRelease' in Window.obj**

**1> wxbase31u.lib (module.obj): error LNK2038: found mismatch for 'RuntimeLibrary': value 'MD_DynamicRelease' does not match value 'MT_StaticRelease' in Window.obj**

**1> wxbase31u.lib (msgout.obj): error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' does not match value 'MT_StaticRelease' in Window.obj**

**1> wxbase31u.lib (translation.obj): error LNK2038: mismatch found for 'RuntimeLibrary': value 'MD_DynamicRelease' does not match 'MT_StaticRelease' in Window.obj**

**1> wxbase31u.lib (utils.obj): error LNK2038: mismatch found for 'RuntimeLibrary': value 'MD_DynamicRelease' does not match 'MT_StaticRelease' in Window.obj**

**1> wxbase31u.lib (main.obj): error LNK2038: mismatch found for 'RuntimeLibrary': value 'MD_DynamicRelease' does not match 'MT_StaticRelease' in Window.obj**

**1> wxbase31u.lib (threadinfo.obj): error LNK2038: mismatch found for 'RuntimeLibrary': value 'MD_DynamicRelease' does not match 'MT_StaticRelease' in Window.obj**

**1> wxbase31u.lib (arrstr.obj): error LNK2038: mismatch found for 'RuntimeLibrary': value 'MD_DynamicRelease' does not match 'MT_StaticRelease' in Window.obj**

**1> wxbase31u.lib (config.obj): error LNK2038: mismatch found for 'RuntimeLibrary': value 'MD_DynamicRelease' does not match 'MT_StaticRelease' in Window.obj**

**1> wxbase31u.lib (stdpbase.obj): error LNK2038: found mismatch for 'RuntimeLibrary': value 'MD_DynamicRelease'**

(也许这些不完全是警告,因为我不得不从我的语言翻译它们):
我做错了什么?我不明白。

mklgxw1f

mklgxw1f1#

您需要在链接标准C++(CRT)库。如果动态链接它们(这是默认的,而且几乎总是一个更好的选择),则需要将可执行文件所依赖的DLL与应用程序一起分发,并确保它们可以在安装应用程序的同一目录中找到。如果使用/MT静态链接,则需要使用/MT动态链接。你必须使用相同的选项来构建你的应用程序和它的所有依赖项,包括wxWidgets。对于wxWidgets,这可以在使用makefile从命令行构建时通过在nmake命令行上传递RUNTIME_LIBS=static来完成。如果你使用项目文件,您必须手动检查所有这些选项的RuntimeLibrary选项(可以通过在IDE中选择多个选项并为所有配置和平台修改此选项来完成)。

相关问题