Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
link error.
Full error message
/MyFolder/main.o:: In function 'MyDialog':
/MyFolder/main.cpp:4: error: undefined reference to 'vtable for MyDialog'
/MyFolder/main.o:: In function '~MyDialog':
/MyFolder/main.cpp:4: error: undefined reference to 'vtable for MyDialog'
collect2: ld returned 1 exit status
|
Technical facts
Application type(s)
Operating system(s) or programming environment(s)
IDE(s):
Project type:
Compiler(s):
Libraries used:
Qt: version 4.7.0 (32 bit)
STL: GNU ISO C++ Library, version 4.4.5
Qt project file: CppLinkErrorUndefinedReferenceToVtableForMyDialog.pro
#-------------------------------------------------
#
# Project created by QtCreator 2010-12-29T14:26:41
#
#-------------------------------------------------
QT += core
QT -= gui
TARGET = CppLinkErrorUndefinedReferenceToVtableForMyDialog
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
|
main.cpp
Solution
Seperate the MyDialog class in a header (.h) file
and an implementation (.cpp) file.
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.
