Difference between revisions of "Error c218: Unknown class/interface '%'"

From wiki.visual-prolog.com

m (Category)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
When this compiler error occurs it is often surprising to the programmer.  The reason is that the [[IDE]] does what it can to safe you from this problem.
When this compiler error occurs it is often surprising to the programmer.  The reason is that the [[IDE]] does what it can to protect you from this problem.


When you write:<vip>class xxx : inputStream
When you write:<vip>class xxx : inputStream
Line 5: Line 5:




The interface is known if the file that defines this interface is ''included'' by the pack file that is being compiled.  Very often you don't have to worry about include directives, because the [[IDE]] inserts them automatically for you (the behaviour is controlled by a setting in the [[IDE]]).  If the relevant interface has been met in the project (during compilation), the [[IDE]] knows which include directive to insert to make the interface known.  So the [[IDE]] inserts the include directive and re-compiles the relevant pack file.  The error disappears and you will not see it at all.
The interface is known if the file that defines this interface is ''included'' by the [[pack file]] that is being compiled.  Very often you don't have to worry about [[include directive]]s, because the [[IDE]] inserts them automatically for you (the behaviour is controlled by a [[IDE Settings|setting]] in the [[IDE]]).  If the relevant interface has been met in the project (during compilation), the [[IDE]] knows which include directive to insert to make the interface known.  So the [[IDE]] inserts the include directive and re-compiles the relevant pack file.  The error disappears and you will not see it at all.


If however the interface has not been met at all the IDE does not know which include directive to insert and the error will remain.  And this is the situation in which you will see the error message.  An this is where you become surprised: "I have written like this many times before, and that never gave such a problem.  So why now?"
If however the interface has not been met at all the IDE does not know which include directive to insert and the error will remain.  And this is the situation in which you will see the error message.  This is where you might ask yourself: "I have written like this many times before, and that never gave such a problem.  So why now?"


There are two ways to get rid of the error:
There are two ways to get rid of the error:
Line 14: Line 14:


[[ru:Error c218: Unknown class/interface '%']]
[[ru:Error c218: Unknown class/interface '%']]
[[Category:Compiler Errors and Warnings|218]]

Latest revision as of 11:27, 18 November 2008

When this compiler error occurs it is often surprising to the programmer. The reason is that the IDE does what it can to protect you from this problem.

When you write:

class xxx : inputStream
    ...

the interface inputStream must be known. If it is not known you will receive the mentioned error.


The interface is known if the file that defines this interface is included by the pack file that is being compiled. Very often you don't have to worry about include directives, because the IDE inserts them automatically for you (the behaviour is controlled by a setting in the IDE). If the relevant interface has been met in the project (during compilation), the IDE knows which include directive to insert to make the interface known. So the IDE inserts the include directive and re-compiles the relevant pack file. The error disappears and you will not see it at all.

If however the interface has not been met at all the IDE does not know which include directive to insert and the error will remain. And this is the situation in which you will see the error message. This is where you might ask yourself: "I have written like this many times before, and that never gave such a problem. So why now?"

There are two ways to get rid of the error:

  1. Either you type in the include directive yourself in the relevant place
  2. Or you add the package that contains the interface/class and compile again, because then the interface/class is suddenly known and the IDE will insert the include directive.