Hi,
What you are trying to do is completely wrong both in terms of C++/programing, as well as meaningfulness.
You created a new YansWifiPhy object and called a method named GetRxGain from that.
Problems with this approach: uninitialized object, you ask for signal strength however you call a method to get the antenna gain...
Otherwise, you can modify the code slightly and use the SNR tag as it is explained in other threads (just search for it in the mailing list).
Regards,
K.