S
S
sddvxd2019-02-05 19:56:29
Qt
sddvxd, 2019-02-05 19:56:29

Undefined refernce to vtable (Qt)?

Good afternoon!
There was such a situation: there is a CMake project, in the root of the folder there is the main CMakeLists, which includes directories (subdirs) and there are already their subprojects (static libraries, dll's), where the source files are located

cmake_minimum_required(VERSION 3.1.0)

project(APP)

set(CMAKE_AUTOMOC 	ON)
set(CMAKE_AUTOUIC 	ON)

set(CMAKE_PREFIX_PATH 	"C:\\Qt64\\5.12.1\\mingw73_64")
find_package(Qt5Widgets Qt5Core REQUIRED)
include_directories(includes gui winapi dll appapi app)

subdirs(
  winapi
  gui
  appapi
  app
        dll

)

There is a gui folder that contains the definition of the main Qt window (MainWindow), this is assembled without problems
. There is also a winapi folder that stores a header file with a class derived from QObject and having a macro Q_OBJECT
class Process : public QProcess{
    Q_OBJECT
    //...
    public:
    virtual ~Process(){};
}

And CMakeLists are folders:
project(WINAPI)

set(SRC_winapi process.cpp)

set(LIBS Dbghelp Psapi)

add_library(${PROJECT_NAME} STATIC ${SRC_winapi})
target_link_libraries(${PROJECT_NAME} ${LIBS})
qt5_use_modules(${PROJECT_NAME} Widgets)

The problem is that the GUI subproject is being built, and WINAPI is failing with the error Undefined refernce to vtable Process
Please tell me what could be the matter

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question