undefined reference to `vtable for shutdown'
-
@JonB , I've changed these prototypes several times with the same result each time, presently they are:
public: shutdown(const char* cpszText, QWidget *pParent = 0); ~shutdown();
-
@JonB , the only place the shutdown.cc.o exists is off the build directory which I am still deleting completely between rebuilds.
@SPlatten
I am lost at this point. It might be that one of the experts knows better than I what situation you are in. You would have to wait for them to see this, perhaps later.At this point, if I were you and I had nothing else to do I would probably take what you have and put it into a brand new, from scratch, standalone tiny project (maybe get rid of the
.ui
file too) and see if I could get it working as (a) a standalone Qt program (provide amain()
) and (b) whatever you are doing for " I have added a class [to] one of the libraries" which I don't know about.public: shutdown(const char* cpszText, QWidget *pParent = 0); ~shutdown();
I do think you should write
virtual ~shutdown();
here, just in case. -
@SPlatten this is wrong. You have always to have virtual in front of a destructor. Otherwise, you may have unpleasant memory leak in your apps.
-
@SPlatten
I am lost at this point. It might be that one of the experts knows better than I what situation you are in. You would have to wait for them to see this, perhaps later.At this point, if I were you and I had nothing else to do I would probably take what you have and put it into a brand new, from scratch, standalone tiny project (maybe get rid of the
.ui
file too) and see if I could get it working as (a) a standalone Qt program (provide amain()
) and (b) whatever you are doing for " I have added a class [to] one of the libraries" which I don't know about.public: shutdown(const char* cpszText, QWidget *pParent = 0); ~shutdown();
I do think you should write
virtual ~shutdown();
here, just in case. -
Just for completeness, here is the actual content of the CMakeLists.txt file:
cmake_minimum_required(VERSION 2.8.10) include (flexelint) set (CMAKE_AUTOUIC ON) set (CMAKE_AUTOMOC ON) set (CMAKE_AUTORCC ON) set (CMAKE_INCLUDE_CURRENT_DIR ON) set (FORMS shutdown_ui) set (HEADERS shutdown.h ui_shutdown.h) set (sources shutdown.cc) set (output vip_backend) add_library(${output} STATIC ${sources}) find_package(Qt4 REQUIRED) include(${QT_USE_FILE}) foreach(loop_var ${QT_LIBRARIES}) string(REPLACE lib64 lib32 loop_var ${loop_var}) set(QT_LIBRARIES_32 ${QT_LIBRARIES_32} ${loop_var}) endforeach(loop_var) qt4_wrap_ui(UI_HEADERS ${FORMS}) qt4_wrap_cpp(MOC_SRCS ${HEADERS}) target_link_libraries(${output} ${QT_LIBRARIES_32}) add_flint(${output})
I have no idea what flexelint is or what it does, same is true of add_flint(${output}).
-
@JoeCFD , ok, I've changed the constructor so it is prefixed with explicit and the destructor with virtual which goes back to how it was and I still have the same issue.
-
@SPlatten forget about Qt Creator. Try to build it from command line
Delete build folder
Create build folder
From build folder cmake ${myvariable}
From build folder make VERBOSE=1
add verbose to see more build details. -
@JoeCFD , that is exactly all I am doing. Also cmake is version 2.8.10.2
rm -R build mkdir build cd build cmake ${myvariable} make
In the CMakeLists.txt file I have:
set (CMAKE_VERBOSE_MAKEFILE ON)
-
@JoeCFD , that is exactly all I am doing. Also cmake is version 2.8.10.2
rm -R build mkdir build cd build cmake ${myvariable} make
In the CMakeLists.txt file I have:
set (CMAKE_VERBOSE_MAKEFILE ON)
-
@SPlatten As Jon commented, you can comment the destructor code out and build. It is a small leak. Not a big deal. shutdown is not a good name for class. Try to avoid to use any system command names as your class names. Name it for example ShutdownWindow.
-
@SPlatten As Jon commented, you can comment the destructor code out and build. It is a small leak. Not a big deal. shutdown is not a good name for class. Try to avoid to use any system command names as your class names. Name it for example ShutdownWindow.
-
@SPlatten As Jon commented, you can comment the destructor code out and build. It is a small leak. Not a big deal. shutdown is not a good name for class. Try to avoid to use any system command names as your class names. Name it for example ShutdownWindow.
@JoeCFD , output has changed:
../../(usage.cc.o): In function 'shutdownNotice(char cont*)': vip_system.cc:(.text+0xe1): undefined reference to `vtable for shutdown' vip_system.cc:(.text+0xe9): undefined reference to `vtable for shutdown' vip_system.cc:(.text+0x100): undefined reference to `vtable for shutdown' vip_system.cc:(.text+0x108): undefined reference to `vtable for shutdown' ../../(shutdown.cc.o): In function 'shutdown::shutdown(char cont*, QWidget*)': shutdown.cc:(text+0x3a): undefined reference to `vtable for shutdown' ../../(shutdown.cc.o):shutdown.cc(.text+0x41): more undefined references to `vtable for shutdown' follow collect2 ld returned 1 exit status
-
are you building on Linux, right? If yes, change your class name with ShutdownWindow (do not forget the ui file).
-
are you building on Linux, right? If yes, change your class name with ShutdownWindow (do not forget the ui file).
-
are you building on Linux, right? If yes, change your class name with ShutdownWindow (do not forget the ui file).
-
@JoeCFD , I was hoping this was going to solve the problems, but sadly not, the reports messages are the same just "shutdownWindow" now instead of "shutdown".