Undefined references to vtable in class constructor?
Hi, got a program which I've been trying to port to Linux for a while now - and after all the changes I can think of making, the build fails with a problem related to one of my main classes. Compilation on Win32 was done with Dev-C++ 4.9.9.2 and on n*x I've been using Anjuta 1.2.4. I've posted on another site about this but so far have had absolutely no luck.
I've been at this for a couple of more days but I can't think of what could be wrong with the below sections of code, in red. The build log and those sections follow: (PS: Before anyone thinks of this, yes I do have virtual functions present in class Sockets, thus the destructor.) Build Log: Code:
Building the whole Project: ConsoleL... Source file: Code:
Include file "network.h": Code:
|
The first error is probably due to you having the scope operator in the class declaration.
Code:
Sockets::Sockets(const Sockets&); Plus does the copy constructor allocated memory? hmmm you are using the scope operator again. (is there a reason for this?) I find it better to include a small check to be safe, like Code:
{delete [] Sockets::SocketConstruct;}; Code:
{if(SocketConstruct)delete [] SocketConstruct;} and lastly why do you have two pointers instead of just the one Code:
int* SocketConstruct; |
Quote:
I took it out completely and that got rid of the error. Sockets() is handling the class fine for now. Quote:
Quote:
But I guess I don't really need that. Anywho, it builds fine now. The "undefined reference to vtable" errors were easy enough to get rid of by including the main virtual functions of Sockets() in its first derived class - without the "virtual" specifier. Thanks for the input. |
All times are GMT -5. The time now is 06:25 PM. |