Before you call bin_p.binary_print(outs, n); you must have declared outs:
something along these lines: ostream outs; this is the most likely place where you have made an error perhaps a typo in variable name.

Another question:

your method does not use the variable <icode>outs</icode> so what is its purpose?

Occasionally you can have problems using references of fstreams but I don't think that this is an issue here.