I am trying to compile code for pfsense and I need g++ in order to successfully do it. Is there any way I can get a g++ package on pfsense? I have tried pkg install g++ without success. If not, is there any equivalent package that I can download?
No. pfSense is a firewall, not a development platform.
Compile the code on a similar FreeBSD system and then copy the binaries to the firewall.