This mimimal test program will not run properly if the SQL supplied is illegal. It crashes inside libqp. No chance is offered to client program to detect and correct the error with facilities like PQerrorMessage(...).
Works for me. What is your build chain and compilation command line? How did you install PostgreSQL?