cm-lib

First off, head to file explorer and create a new subfolder underneath cm-lib called source; move cm-lib_global.h there. Create another subfolder in source called models and move both the Client class files there.

Next, back in Qt Creator, open up cm-lib.pro and edit it as follows:

QT -= guiTARGET = cm-lib
TEMPLATE = libCONFIG += c++14DEFINES += CMLIB_LIBRARYINCLUDEPATH += source
SOURCES += source/models/client.cpp
HEADERS += source/cm-lib_global.h \
    source/models/client.h

As this is a library project, we do not need to load the default GUI module, so we exclude it using the QT variable. The TARGET variable is the name we wish to give our binary output (for example, cm-lib.dll). It is optional and will default to the project name if ...

Get Learn Qt 5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.