Custom library, #define variable is not defined

Hi. I am trying to make my own library according to arduino library tutorial. But I am facing problem in variables. I have defined few variables in my sketch such as,

define MY_SSID "Ahmed"

define MY_PASSWORD "My_PAssw@rD"

When I make header file, myLibrary.h and put all code in header file, every thing works fine, but when I separate functions from header related stuff and make .cpp file, it gives error about these variables that they are not defined. May someone shed light on it?

The #defines in your sketch aren't visible to your library. You could put those into regular variables instead of #define and use an extern declaration in the library to let the library know that they are defined elsewhere.

in .ino

char* MY_SSID = "Ahmed";

in .cpp

 extern char* MY_SSID;

I have defined few variables

Those are NOT variables. Those are name, value pairs that disappear before the compiler is invoked.