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

  • Home
  • SEARCH
  • 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 8735199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:59:51+00:00 2026-06-13T09:59:51+00:00

I have a functor base class and a functor derived class that looks like

  • 0

I have a functor base class and a functor derived class that looks like this:

class ReadSensor
{
public:
    ReadSensor();
    virtual ~ReadSensor(void){}
    virtual int operator()(void) = 0;
};

class ReadSensorDummy : public ReadSensor
{
public:
    ReadSensorDummy() : x(0) {}
    ReadSensorDummy(int x): x(x) {}
    ~ReadSensorDummy(void) {}
    int operator() (void) { return x;}
private:
    int x;
};

I am creating it as so:

ReadSensor *rs =  new ReadSensorDummy(5);

It compiles, but I get the following link error:

Error   2   error LNK2019: unresolved external symbol "public: __cdecl ReadSensor::ReadSensor(void)" (??0ReadSensor@@QEAA@XZ) referenced in function "public: __cdecl ReadSensorDummy::ReadSensorDummy(int)" (??0ReadSensorDummy@@QEAA@H@Z) W:\SafetySystemTest.obj

What is wrong? A dynamic_cast shouldn’t be needed, but I did try it and it didn’t help.

  • 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-13T09:59:52+00:00Added an answer on June 13, 2026 at 9:59 am

    You have declared the intention to define a constructor for ReadSensor, but the compiler did not find one defined in any of your source files. You can try defining an empty one, or removing the declaration.

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

Sidebar

Related Questions

I have a functor like this, class PrintParentheses { public: PrintParentheses(unsigned pairsCount) {} void
I have this functor: struct functor { template<class T> void operator()(T value) // (*)
I'd like to have functor class like this: public class Functor<T, R> { public
If I have a functor like this... class DoStuff { private: std::vector < int
I have an abstract functor class that overloads operator() and derived objects that implement
I have the following functor: class ComparatorClass { public: bool operator () (SimulatedDiskFile *
Assume you have a functor: struct MyFunctor { bool operator ()( int value )
I have a GADT that's a lot like this: data In a where M
I have a templated base class which follows: template<class scalar_type, template<typename > class functor>
I have a base class, Parameter, and two derived classes: Scalar & Vector. In

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.