# source of a ToExpression::sntxi error when running Install[]

I have been getting an "ToExpression::sntxi: Incomplete expression; more input is needed" error when trying to Install[] a new WSTP program I've written. It's entirely possible that there is some problem with the WSTP program, but this error doesn't give me a clue what it might be. I haven't even called the program yet, merely tried to Install[] it. Is there a WSTP or Install[] guru who might be able to suggest the circumstances under which running Install[] can produce such an odd error? For the record, a WSTP program does end up running, though unusable as it has returned only \$Failed to the kernel.

Other WSTP programs install and run just fine.

• @MichaelStern Yes. You can check in the produced C file. It is partly this Mathematica code that sets up definitions when Install is run. It is also allowed to put arbitrary M code in the .tm file, which will be run on Install[]. – Szabolcs Aug 31 '16 at 10:42