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'