Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>When the compiler tells you that something "was not declared in this scope," as yourself this question:</p> <p><strong>What scope <em>was</em> is declared in?</strong></p> <p>If you can't answer that question, then you've discovered the problem. After all, if <em>you</em> don't know what that name refers to, how can you expect the compiler to? Remember that <em>you</em> are the expert on any code <em>you</em> write.</p> <p>If you <em>can</em> determine what scope the thing is declared in, then the next task is to determine how that scope relates to the scope you're trying to use it in. Typical problems include (but are not limited to) the following:</p> <ul> <li>It was declared in some other namespace. Use the <code>::</code> scope-resolution operator to give a fully qualified name.</li> <li>It was declared as a member of a class and you're trying to use it in a standalone function. Either find a instance of the class and access the variable or function through that object, or change the class to have your new function as one of its members.</li> </ul> <p>If you <em>can't</em> find what scope it was declared in, then there are a few things that might be wrong:</p> <ul> <li>You've spelled it wrong. Check the spelling in the documentation and fix your code.</li> <li>It's declared in some header that you've forgotten to include. Figure out where it's declared and add the appropriate <code>#include</code> directive. <strong>This is probably the problem in your case.</strong></li> <li>It's not declared anywhere. Figure out where it <em>should</em> be declared and declare it there yourself.</li> </ul>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload