-
January 25th, 2013, 02:19 PM
#1
What does "candidate function(s) not accessible" mean?
I have a new managed C++ Form project (my first) and if I try to declare a StreamReader object I get an error that I don't understand:
Code:
private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {
StreamReader sr;
}
This generates an error on compiling:
error C3767: 'System::IO::StreamReader::StreamReader': candidate function(s) not accessible c:\my documents\visual studio 2008\projects\windowsforms\windowsforms\Form1.h
Can someone explain what this means please?
Thanks
-
January 25th, 2013, 10:00 PM
#2
Re: What does "candidate function(s) not accessible" mean?
You're trying to default-construct a StreamReader object. That class does have a default constructor, inherited from TextReader, but it's protected, so you can't access it from your code. That leads to the irritating error message you got instead of a plain "that doesn't exist". Use one of the several public StreamReader constructors instead.
Last edited by Eri523; January 28th, 2013 at 04:13 PM.
I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.
This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.
-
January 28th, 2013, 09:44 AM
#3
Re: What does "candidate function(s) not accessible" mean?
Thank you very much. The MSDN explanation for this error is more cryptic than the error message.
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
|