Compiler is giving "does not name a type" for a few libraries

I have installed LedControl, and RCSwitch libraries....and the compiler error is very similar
on similar lines
At RCSwitch mySwitch = RCSwitch(); it says RCSwitch does not name a type
also
at LedControl lc=LedControl(12,11,10,1); it says LedControl does not name a type

I am at the copy paste state, and have followed tutorials carefully, this has to be some
generic problem. Please help. Thank you.

this has to be some
generic problem.

It is. You clearly failed to read the sticky at the top of the forum that describes how to post in this forum.

You clearly failed to post any links. You clearly failed to post any code. You clearly failed to post EXACT error messages.

I have installed LedControl, and RCSwitch libraries

Where? In the reading rack in the bathroom? Don't you think that where might matter?

ngupta99:
I have installed LedControl, and RCSwitch libraries....and the compiler error is very similar ...

How did you install them? Any problem with copying and pasting the exact error?

The library was in Documents/Arduino/libraries
2 files
RCSwitch.cpp
RCSwitch.h

The top section of my .ino was
/*
RF_Sniffer

Hacked from http://code.google.com/p/rc-switch/

by @justy to provide a handy RF code sniffer
*/

#include <RCSwitch.h>
RCSwitch mySwitch = RCSwitch();

void setup() {
Serial.begin(9600);
mySwitch.enableReceive(0); // Receiver on inerrupt 0 => that is pin #2
}

and the error code was
“RCSwitch does not name a type”
with the line below #include highlighted

I am really sorry, I thought I gave the relevant information earlier. I will learn better. thank you.

RCSwitch.h and RCSwitch.cpp do not belong in the libraries folder. They belong in a folder called RCSwitch in the libraries folder.

RCSwitch mySwitch = RCSwitch();

That is not how to create an instance of the RCSwitch class. Lose everything from the = on, except the ;.