A Sample Perimeter Detection Script?

Hello,

Can you please provide a sample C Perimeter program ?

I want to be able to see if the perimeter line 1 or 2 is closed, and then if it is open.

I am compiling with
gcc -o TestZ TestZ.c -lzk_app_utils -lpthread

but when I run any function in TestZ I get the following:
TestZ: tpp.c:84: __pthread_tpp_change_priority: Assertion `new_prio == -1 || (new_prio >= fifo_min_prio && new_prio <= fifo_max_prio)’ failed.

What else do I need to include on the gcc command line ?