Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8103067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:25:10+00:00 2026-06-05T23:25:10+00:00

I am trying to create a derived class object in base class method. I

  • 0

I am trying to create a derived class object in base class method.

I am getting the error as mentioned above. Below is a code snippet.

Any help?

 ---- Voip_connection.hh ---- 

   #ifndef __VOIP_CONNECTION_HH
   #define __VOIP_CONNECTION_HH

 class VoipConnection {
 public:

VoipConnection();
VoipConnection (ConnectionState* cs);

void update_last_data_rcvd_time() { last_data_rcvd_time_ = msec_time(); }
uint64_t last_data_rcvd_time() { return last_data_rcvd_time_; }
void set_voip_proto(int proto) { voip_proto_ = proto;}

~VoipConnection()
{
    --nx_stat().act_connections;
    voip_idle_wait_timer_clear();
    sv_streaming_offset_ = 0;
    cl_streaming_offset_ = 0;
}


// Lots and Lots of Other stuff



  }


----Voip_sip.hh -----

#ifndef __VOIP_SIP_HH
#define __VOIP_SIP_HH
#include "voip_connection.hh"

class SipObj: public VoipConnection 
{

    /* stuff */
} 


--- Voip_connection.cc ----
#include "voip_connection.hh"

class SipObj; // Tried this in .hh file as well. 

VoipConnection::voip_process_pdu(bool from_client) 
{
 SipObj sip;
 sip.process(datap, &pdu_len);
 }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T23:25:12+00:00Added an answer on June 5, 2026 at 11:25 pm

    In order to instantiate a class, you need the complete type. This

    SipObj sip;
    

    requires the full definition of SipObj. A simple forward declaration won’t do, you need to include the appropriate header.

    In general, I would say that having a base class depend explicitly on one of it’s derived types is a pretty bad idea.

    Concerning the other error you report, it simply says that class VoipConnection has no default constructor. So you will have to provide one.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a class that serves as a base object, which will
Trying to create a Driver type class where, below, Base is the Driver that
Trying to create a background-image slideshow and am getting this error... This is the
Trying to create COM -object on server. code is: var myGuid = new Guid(530A1815-820C-11D3-BBB7-008048DE406A);
I'm trying to code the following situation: I have a base class providing a
What I am trying to do is create a base class, for which anything
I am trying to use inheritance to create a class derived from runtime_error ,
I'm trying to setup a base class and derived class with ExtJS using Ext.extend
I am trying to create a base class where I can inherit from it
I've been trying to create a simple base class that encapsulates some of my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.