First of all, you should compile the app with -noixemul.
Additionally the code depends on the library bases being opened automagically so you may need to add libauto (-lauto). Some systems don't have working libauto in which case you need to open the library bases manually as described earlier.