GUI.anything not working

I have a problem, that unity says, that " ‘GUI’ does not contain a definition for (for example)`Button’ ".
I have written the code in OnGUI, and even copy pasted some of the unity scripting references, but it doesn’t work.
bizarrly, the GUI stuff in my old projects is working just fine.
Thanks in advance

Typically this happens if you have named one of your scripts or classes ‘GUI’. Your class then overrides the built-in GUI class. The solution is to rename your script/class to something other than GUI.