Linker Error Undefined Reference To Vtable For Class
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the error undefined reference to vtable for qt workings and policies of this site About Us Learn more about Stack the vtable symbol may be undefined because the class is missing its key function Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs undefined reference to vtable for constructor Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join
Undefined Reference To Vtable For C++
them; it only takes a minute: Sign up Linker error: undefined reference to vtable [duplicate] up vote 2 down vote favorite This question already has an answer here: What is an undefined reference/unresolved external symbol error and how do I fix it? 25 answers I'm hoping that you can help me with my problem, this program is a theater reservation undefined reference to vtable qobject program. main.cpp { #include
here for a quick overview of the site Help Center Detailed answers undefined reference to `typeinfo for to any questions you might have Meta Discuss the workings
Undefined Reference To Vtable For Destructor
and policies of this site About Us Learn more about Stack Overflow the company Business
Undefined Reference To Vtable For Class C++
Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack http://stackoverflow.com/questions/15154980/linker-error-undefined-reference-to-vtable Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up GCC C++ Linker errors: Undefined reference to 'vtable for XXX', Undefined reference to 'ClassName::ClassName()' up vote 64 down vote favorite 27 I'm setting up a http://stackoverflow.com/questions/1095298/gcc-c-linker-errors-undefined-reference-to-vtable-for-xxx-undefined-refere C++ project, on Ubuntu x64, using Eclipse-CDT. I'm basically doing a hello world and linking to a commerical 3rd party library. I've included the header files, linked to their libraries, but I still get linker errors. Are there some possible problems here other than the obvious (e.g. I am 99% sure I'm linking to the correct library). Is there a way to confirm the static libraries I am linking to are 64bit? Is there a way to confirm that the library has the class (and methods) I am expecting it to have? Eclipse says: Building target: LinkProblem Invoking: GCC C++ Linker g++ -L/home/notroot/workspace/somelib-3/somelib/target/bin -o"LinkProblem" ./src/LinkProblem.o -lsomelib1 -lpthread -lsomelib2 -lsomelib3 ./src/LinkProblem.o: In function `main': /home/notroot/workspace/LinkProblem/Debug/../src/LinkProblem.cpp:17: undefined reference to `SomeClass::close()' ./src/LinkProblem.o: In function `SomeOtherClass': /home/notroot/workspace/somelib-3/somelib/include/sql/somefile.h:148: undefined reference to `SomeClass::SomeClass()' /home/notroot/workspace/somelib-3/somelib/include/sql/somefile.h:148: undefined reference to `vtable for SomeOtherClass' /home/notroot/workspace/somelib-3/somelib/include/sql/somefile.h:151: undefined reference to `SomeClass::~SomeClass()' ./src/LinkProblem.o: In function `~SomeOtherClass': /home/notroot/workspace/somelib-3/somelib/include/sql/somefile.h:140: undefined reference to `vtable for
here for a quick overview of the site Help Center Detailed answers to any questions you http://stackoverflow.com/questions/17865440/linker-error-undefined-reference-to-vtable might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or http://www.cplusplus.com/forum/general/69623/ posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of undefined reference 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Linker Error undefined reference to vtable up vote 2 down vote favorite I seem to be having an issue with a wxWidgets project I'm working on. I keep getting a vtable linker error for a class undefined reference to that doesnt involve any virtual functions. I was wondering if someone could shed some light on this issue, since in my understanding there shouldnt be a vtable for a class that doesnt use virtual functions. Most similar topics I've seen occur when someone forgets the define the deconstructor, but I'm pretty sure the deconstructor was correctly defined. the errors can be seen below. ||=== Hike Planner GUI, Debug ===| obj\Debug\GUIFrame.o||In function `PlanWindow':| E:\Projects\Hike Planner GUI\GUIFrame.cpp|76|undefined reference to `vtable for PlanWindow'| E:\Projects\Hike Planner GUI\GUIFrame.cpp|76|undefined reference to `vtable for PlanWindow'| obj\Debug\GUIFrame.o||In function `~PlanWindow':| E:\Projects\Hike Planner GUI\GUIFrame.cpp|81|undefined reference to `vtable for PlanWindow'| E:\Projects\Hike Planner GUI\GUIFrame.cpp|81|undefined reference to `vtable for PlanWindow'| E:\Projects\Hike Planner GUI\GUIFrame.cpp|81|undefined reference to `vtable for PlanWindow'| ||=== Build finished: 5 errors, 0 warnings ===| segment from GUIFrame.h class PlanWindow : public wxWindow { DECLARE_EVENT_TABLE() public: PlanWindow(wxWindow* parent, wxWindowID id); ~PlanWindow(); void GetLocationList(int RetCode); wxListBox *PlanList; }; Segment from GUIFrame.cpp: PlanWindow::PlanWindow(wxWindow* parent, wxWindowID id) : wxWindow(parent,id) { } PlanWindow::~PlanWindow() { } voi
on a plugin framework for an application, which will work by dynamically loading shared/dynamic libraries that contain classes (unknown to the application) that derive from base classes (known to the application). I'm using MinGW with GCC and GNU-Make. The compiler output is below, including the rather strange linker error. g++ -DBUILDING_DLL -c -o plugin.o classes.cpp g++ -shared -o plugin.dll plugin.o plugin.o:classes.cpp:(.text$_ZN9baseClassC2Ev[baseClass::baseClass()]+0x8): undefined reference to `vtable for baseClass' collect2: ld returned 1 exit status mingw32-make: *** [plugin.dll] Error 1 The problem appears to be in baseClass' constructor, which I haven't defined. I get the same error, but twice, if I define baseClass' constructor as 'baseClass() {}', as I did with derivedClass (see code). The code isn't too long, I'll post it below. Help is appreciated. I think I'm doing something wrong with constructors, but I'm not sure what. classes.h 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// classes.h #ifndef CLASSES_H #define CLASSES_H #ifdef BUILDING_DLL #define DLL_INTERFACE __declspec(dllexport) #else #define DLL_INTERFACE __declspec(dllimport) #endif class DLL_INTERFACE baseClass { public: virtual void testFunc(); }; class DLL_INTERFACE derivedClass : public baseClass { public: derivedClass() {}; ~derivedClass() {}; void testFunc(); private: void privateFunc(); }; #endif classes.cpp: 1
2
3
4
5
6
7
8
9