-
October 3rd, 2013, 03:15 PM
#1
About Error C2061 - VS 2010
Hi ! I am currently working on a large software involving VS 2010 and a bunch of classes. I'm having a lot of compilation errors C2061 about the class A. All these errors are in header files involving pointer to that class A. I checked not having circular references. I have forward reference to that class A at the top of each concerned header and just after "#include ...". When moving the forward reference to the class A just before the lineinvolving the pointer I don't have compilation error any more. Could you please tell me why it's so ? Many thanks.
-
October 3rd, 2013, 04:17 PM
#2
Re: About Error C2061 - VS 2010
Victor Nijegorodov
-
October 3rd, 2013, 04:23 PM
#3
Re: About Error C2061 - VS 2010
Thanks.
Could you please answer my question ?
-
October 3rd, 2013, 05:32 PM
#4
Re: About Error C2061 - VS 2010
Originally Posted by mulfycrowh
Thanks.
Could you please answer my question ?
You mean this question?
When moving the forward reference to the class A just before the lineinvolving the pointer I don't have compilation error any more. Could you please tell me why it's so ?
Well, the simple answer is that you were violating the rule of having an undefined type, and you were using it. By moving the declaration to where the compiler knows the type, the mistake was corrected. What else could it be?
It would have helped if you actual provided a code sample instead of describing what you're doing.
Regards,
Paul McKenzie
-
October 4th, 2013, 01:57 AM
#5
Re: About Error C2061 - VS 2010
Originally Posted by mulfycrowh
I have forward reference to that class A at the top of each concerned header and just after "#include ...". When moving the forward reference to the class A just before the lineinvolving the pointer I don't have compilation error any more. Could you please tell me why it's so ?
Originally Posted by mulfycrowh
Could you please answer my question ?
I wonder how that could be answered without seeing what your real code looks like. There may be some syntax error. Or some conditional compilation that hides that forward declaration. Or something else that you missed or did not mention.
Best regards,
Igor
-
October 4th, 2013, 02:03 AM
#6
Re: About Error C2061 - VS 2010
My software is very huge : tens of classes. So difficult to post here unless you get it on a private message. Thanks a lot
-
October 4th, 2013, 03:11 AM
#7
Re: About Error C2061 - VS 2010
Originally Posted by mulfycrowh
My software is very huge : tens of classes. So difficult to post here unless you get it on a private message. Thanks a lot
You don't need to post your "very huge" code. Only some very small files that reproduce your problem!
Victor Nijegorodov
-
October 4th, 2013, 04:20 AM
#8
Re: About Error C2061 - VS 2010
Originally Posted by mulfycrowh
My software is very huge : tens of classes.
So seriously, you want us to figure out why your "huge software" is giving you a compilation error, and we don't even know a single line of your code?
Well since you're the maintainer of this code, then the answer is the one I gave you previously. It is now your job in figuring out why the definition is unknown, given all the reasons Igor pointed out.
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
|