Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the C++ Runtime Library setting in QtCreator?

Tags:

c++

qt

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.

like image 978
the_naive Avatar asked May 22 '13 09:05

the_naive


People also ask

Does Qt Creator support C?

In addition, the Qt Creator Bare Metal Device plugin provides support for the following compilers: IAREW is a group of C and C++ bare-metal compilers from the various IAR Embedded Workbench development environments. Note: Currently supported architectures are 8051 , AVR , ARM , STM8 , and MSP430 .

Where does Qt Creator store settings?

On Windows in general, the files are located in %APPDATA%\QtProject and %LOCALAPPDATA%\QtProject . Yes, you can use these paths in Explorer and in various command line shells.

Does Qt support C ++ 17?

As mentioned, Qt 6 makes C++17 a requirement in order to adopt its more advanced language features.


2 Answers

/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
like image 197
Violet Giraffe Avatar answered Oct 22 '22 13:10

Violet Giraffe


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
like image 35
nicksona Avatar answered Oct 22 '22 13:10

nicksona