I'm absolutely new to Qt. I've made a program using C++ in Visual Studio 2010 in which I use the external library from Dcmtk. I now want to add a user interface to that program. In my original program I had to change the C++ Runtime Library in Code Generation setting in Visual Studio to Multi-Threaded(/MT) from Multi-Threaded Debug DLL otherwise the program would not work. I have to do the same in QtCreator, but I don't know how to change that setting in Qt. Could you please suggest how I should approach that? Thanks.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
/MT is a compiler flag. You can specify flags in your .pro file like this:
QMAKE_CXXFLAGS += /MT
Moreover, you probably want to specify /MTd for debug build:
Release:QMAKE_CXXFLAGS += /MT Debug:QMAKE_CXXFLAGS += /MTd 回答2:
In the version of QT 5.5 the variable is QMAKE_CXXFLAGS_DEBUG and QMAKE_CXXFLAGS_RELEASE so the new working solution for QT 5.5 is:
QMAKE_CXXFLAGS_DEBUG += /MTd QMAKE_CXXFLAGS_RELEASE += /MT 回答3:
A qmake configuration is also available for this.
CONFIG += thread