|
-
May 29th, 2013, 04:15 AM
#4
Re: Compiler says there is no constructor, but it does have one.
 Originally Posted by lucky6969b
Code:
activity = new Idle(this, NULL);
class Idle : public Activity
{
private:
float mTimeInIdle;
public:
Idle() : mTimeInIdle(0) { }
Idle(Objects *actor, Goods *target) : Activity(actor, target)
{
}
Error 1 error C2514: 'Idle' : class has no constructors d:\jacky\documents\visual studio 2010\projects\perfectsim\perfectsim\perfectsim\Objects\Objects.h 43 1 PerfectSim
The activity = new Idle(this, NULL) line is located inside the Objects::Objects(...) constructor.
Would it be caused by some cyclic dependencies? How do I go about resolving it?
Thanks
Jack
How can we answer you if you post incomplete code, with only descriptions of what you may or may not have done in some other module?
If you get a compiler error, it is imperative you post the smallest example that properly generates the error without anyone having to remove or add lines to get the same or similar error. If I took the code you posted and tried to compile it, of course there will be errors all over the place.
Regards,
Paul McKenzie
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
|