So i know that if i declare two classes i can call the functions in the first class from the second class but how do i call functions in the second class from the first?
First, why do you use global variables? There are usually better alternatives.
The problem in the current code is that by the line 8, the compiler has not been told yet anything about identifier "qClass2". It does not know the type if the identifier, nor whether that type has members.
You could create a thousand objects of type class1, but your current implementation would make them all call a member of one particular global object of type class2. That is awfully restrictive. Granted, class2::f2() does refer to single global object too, but std::cout is very special.
as for the global variables its the only way ive ever been able to get my programs to work. if i declare my instances in the top of the main function like i see in most examples the program never works right. i know this is something i need to learn its just that i have things higher on my priority list atm is all. i mean you see im having scope problems right now even with them declared at the global level.