But that has nothing to do with your C++ program.

You'd get the same error message just by typing in manually:
graph -T X < abc.txt

Maybe it's complaining that there are an odd number of...