Q
Q
Qyzz2020-06-09 16:06:24
Qt
Qyzz, 2020-06-09 16:06:24

How to compile a Qt project into an executable?

Hello. I'm trying to build a project on qt through qt creator. Everything compiles and debugs normally, but in the folder with the compiled project there is only a shared library, instead of an executable one.

Actually the question is how to get an executable file as a result of compilation?

Platform: Manjaro.
There is a main function.

CMakeList.txt

cmake_minimum_required(VERSION 3.5)

project(texted LANGUAGES CXX)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(Qt5 COMPONENTS Widgets REQUIRED)

add_executable(texted
    main.cpp
    mainwindow.cpp
    mainwindow.hpp
    mainwindow.ui
)

target_link_libraries(texted PRIVATE Qt5::Widgets)


Compilation result
5edf88833499c858811410.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Q
Qyzz, 2020-06-09
@Qyzz

Through the console, the texted file is executed ("./texted"). The question is closed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question