Chaitanya
Chaitanya

Reputation: 11

fatal error: QCoreApplication: No such file or directory, using CMake

I'm new to QT.

I created the code in QT Application with support of QMake, then I migrated the code in a CMake compatible application.

Since then I'm getting QCoreApplication no such file/directory error.

It also gives following message:

23:03:11: The process "/usr/bin/cmake" exited with code 2. Error while building/deploying project HCIServer (kit: CMake-New-Kit) The kit CMake-New-Kit has configuration issues which might be the root cause for this problem. When executing step "Make"


Kit Configuration:

Upvotes: 1

Views: 6067

Answers (1)

Tomaz Canabrava
Tomaz Canabrava

Reputation: 2408

your CMake configuration is wrong.

This is a really small configuration file for CMake based projects:

project(HCIServer)
cmake_minimum_required(VERSION 2.8)
set(CMAKE_CXX_STANDARD 11)

find_package(Qt5 REQUIRED COMPONENTS Core Widgets)
add_executable(${PROJECT_NAME} main.cpp mouseevent.cpp udpserver.cpp)
target_link_librarieS(${PROJECT_NAME} Qt5::Widgets)

without the find_package, CMake doesn't knows where to look for Qt, and whithout target_link_libraries, CMake doens't know what your application needs.

Upvotes: 1

Related Questions