than every time when i #include "myclass.h"
compiler would compile myclass.cpp separately and than would link it to the rest of the project.
How could i precompile this myclass.cpp and probably also myclass.h so i could insta #include this class (would love if i could use it like #include <myclass> ) without a need to compile them every time together with the rest of files. Also without need to make sure they are in the same directory as main.cpp
than every time when i #include "myclass.h"
compiler would compile myclass.cpp separately and than would link it to the rest of the project.
Nope, you will need to pass myclass,cpp as argument to the compiler or add it to project, if you are using some IDE.
Header file (I will not touch concept of templates right now) contains declarations: promises, that some entity will exist in linking stage. It is up to you to provide it.
Relation myclass.h ←→ myclass.cpp is only for convinience. You can rename myclass.h to some_random_name.h and it will work just as well.
To create a precompiled library you just need to compile some file without linking (look up your compiler documentation to know how). However, you will still need to tell compiler that you want to link that library with your programm.