Template classes question in c++

i have this class (template) “a” that has another type of class (also a template) “b” as a private attribute. The thing is in my work i can only include the first (a)class in the main.cpp file, not the second one (b). Is it allowed to include a class in to another one since i can’t put both in the main cpp file? Or it may cause some problems?
Another question: if the attribute b is also a pointer, is this the right way to declared it
b<T>* ptr;
because when i try to compilde the code, i got some errors and it seems like the compiler doesn’t recognize that syntax