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 1009187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:53:11+00:00 2026-05-16T08:53:11+00:00

In my PDBComponent class’s header file, I just created a new constructor for a

  • 0

In my PDBComponent class’s header file, I just created a new constructor for a grand total of two constructors:

class PDBComponent {
    public:
        PDBComponent(string name,double min_current,double nom_current,
                     double max_current, EPSCommands* command_ptr, double delay);
        PDBComponent(string name,double min_current,double nom_current,
                     double max_current, EPSCommands* command_ptr, EPSFault* fault_ptr ,double delay);
...

And when I use the first constructor, I get no compile error. Like so:

PDBComponent component = PDBComponent("STX"     ,0.1,  0.5,  1.0
        ,new EPSCommands( 1.0, 3.0),0.0);

However when I use the second constructor I get a compile error::

PDBComponent component = PDBComponent("STX"     ,0.1,  0.5,  1.0
        ,new EPSCommands( 1.0, 3.0), new EPSFault(EPSFault::OpenCircuit,2.0),0.0);

The compile error:

error C2661: ‘fs5system::PDBComponent::PDBComponent’ : no overloaded function takes 7 arguments

I thought that maybe I was working with one header file while the compiler was looking at another, so I commented out the first constructor. The compiler showed that it was recompiling the PDBComponent.cpp and then showed an error:

error C2511: ‘fs5system::PDBComponent::PDBComponent(std::string,double,double,double,fs5system::EPSCommands *,double)’ : overloaded member function not found in ‘fs5system::PDBComponent’

…which indicates that the compiler is indeed looking at the correct header file.

Anybody know why I’m seeing this behavior?

I’m compiling with Visual Studios C++.


More Clues:

I just added the following line to the class definition in the header file:

bool trash() {return true;}

And tested it with

PDBComponent* component;
component = new PDBComponent("STX"     ,0.1,  0.5,  1.0
        ,new EPSCommands( 1.0, 3.0),0.0);

cout << component->trash() << endl;

in my main file. When compiling, the PDBComponent header is again compiled. I get error message:

error C2039: ‘trash’ : is not a member of ‘fs5system::PDBComponent’

  • 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-05-16T08:53:11+00:00Added an answer on May 16, 2026 at 8:53 am

    So, you get an error when the 6-parameter constructor is being compiled when you’ve commented it out in the header – but is that the same source file that contains the calls to the constructor? Is it possible that a different header is being used for that compilation somehow (maybe precompiled header weirdness is involved).

    Try using the /showIncludes option (“C++ | Advanced | Show includes” in the IDE’s project settings) and/or turning off precompiled headers and see if you get any further clues or better behavior.

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

Sidebar

Related Questions

Is it possible to store a bunch of objects by their base class in
I was trying to incorporate Search plugin to my project and I thought I
I have a monetary amount that is entered by a user and want to
I want my code to randomize between three different functions: private void BackPack1() {
I'm look for good alternatives to invoking a specific interface from a generic framework.
I used CMake and Visual C++ to build the HyDE library. Then, still 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.