Get the App
SLTechnology News&Howtos  ›  Servers  › 

C++ to Qt compilation process method

Shulou Source: shulou.com Published: 2022-06-02 20:42:06 11月14日 Update

C++ to Qt

Qt is the library of C++, and Qt extends it a little bit based on ansi C++.

But the domestic seems to be more impetuous, a lot of people who learn Qt even don't seem to know how to compile the basic C++. This article abandons the shackles of IDE or qmake, cmake and other tools, and tries to transition from the compilation of C++ to the compilation of Qt step by step through a few examples.

This article deals with the most basic things, perhaps it can be said that as long as you use C++ Qt, no matter which tool (qmake, cmake, boost.build, qtcreator, vs2008, Eclipse,...), the content of this article needs to be understood (although when we really write programs, we will not directly use the C++ compiler to compile Qt programs).

If you are afraid of the command line.

Example 1: a simple console program

A very simple example that doesn't use the Qt extension: (that is, this is a normal C++ program)

# include # include int main (int argc, char** argv) {QCoreApplication app (argc, argv); qDebug ()

Tags: Compiling files programs caching links examples commands functions consoles controls parameters compilers paths generation preprocessing necessary portals subsystems things tools Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux MariaDB Shulou Technology Redmi Xiaomi