Help applying print_stk patch

Yang Zhang <[email protected]> Wed, 26 Nov 2008 14:34:28 -0500
Newsgroups gmane.comp.lib.state-threads.user
Message-ID <[email protected]>
I did:

patch < print_stk.patch # manually patched Makefile
CONFIG_GUESS_PATH=/usr/share/misc/ make default-debug

then built the following program, stbt.c:

#define DEBUG
#include <st.h>
#include <signal.h>
void *f(void *p) {
   st_sleep(10);
   return NULL;
}
void h(int s) {
   _st_print_thread_stacks(0);
}
int main() {
   struct sigaction sa;
   sa.sa_handler = h;
   sigemptyset(&sa.sa_mask);
   sa.sa_flags = 0;
   sigaction(SIGINT, &sa, NULL);

   st_init();
   st_thread_t ts[3];
   int i; 

   for (i = 0; i < 3; i++)
     ts[i] = st_thread_create(&f, NULL, 1, 0);
   for (i = 0; i < 3; i++)
     st_thread_join(ts[i], NULL);
   return 0;
}

but then I got:

$ CPATH=/tmp/st-1.8/LINUX_2.6.27-7-generic_DBG/ 
LIBRARY_PATH=/tmp/st-1.8/LINUX_2.6.27-7-generic_DBG/ gcc stbt.c -lst
/tmp/ccoL3i05.o: In function `h':
stbt.c:(.text+0x2e): undefined reference to `_st_print_thread_stacks'
collect2: ld returned 1 exit status

objdump shows that _st_print_thread_stacks is there in the .a file and 
non-static.  Any hints?
-- 
Yang Zhang
http://www.mit.edu/~y_z/

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/