-
May 24th, 2009, 02:25 PM
#1
Abstract type problem
Hi people,
I am really struggling with this one!
My class and implementation: (it should inherit from MyFramework::
TcpReceiver)
------------------------- >MyConnection.h
#ifndef MYCONNECTION_H_
#define MYCONNECTION_H_
#include "TcpReceiver.h"
class MyConnection : public MyFramework::TcpReceiver {
public:
MyConnection(const std::string &cfg, const std::string &feed_name);
~MyConnection();
};
#endif
--------------------->MyConnection.cpp
#include <iostream>
#include "MyConnection.h"
using namespace std;
using namespace MyNamespace;
using namespace MyFramework;
MyConnection::MyConnection(const std::string &config, const
std::string &connection){
cout<<("Calling constructor")<<endl;
};
MyConnection::~MyConnection(){};
------------------------> In my main, I do this:
MyConnection recv(config, connection);
ERROR: cannot declare variable recv to be of abstract type
MyConnection.
Now this is driving me nuts.HELP!
-
May 24th, 2009, 02:43 PM
#2
Re: Abstract type problem
What pure virtual functions in MyFramework::TcpReceiver are not in MyConnection?
If my post was interesting or helpful, perhaps you would consider clicking the 'rate this post' to let me know (middle icon of the group in the upper right of the post).
-
May 25th, 2009, 12:16 AM
#3
Re: Abstract type problem
Yes, as pointed out JVene. There are some virtual function in base class that are not defined in derived class.
Look into it.
Thanks for your help.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|