From: Yang Z. <yan...@gm...> - 2008-12-01 21:28:26
|
Yang Zhang wrote: > Mike Abbott wrote: >>> $ 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 >> >> I get exactly the same error when I use the wrong path >> (the wrong LINUX_whatever_DBG), but when I use the right path the gcc >> command works. Then when I run >> "LD_LIBRARY_PATH=/tmp/st-1.8/LINUX_whatever_DBG ./a.out" it runs fine. >> >> >> >> ------------------------------------------------------------------------- >> 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=/ >> _______________________________________________ >> State-threads-users mailing list >> Sta...@li... >> https://lists.sourceforge.net/lists/listinfo/state-threads-users > > Whoops. Turned out I had two libst.a's on my system, and the other one > was getting in the way. Now I can build and run the program: #define DEBUG #include <st.h> void h(int s) { _st_print_thread_stacks(0); } void *f(void *p) { st_sleep(1); h(0); return NULL; } int main() { st_init(); st_thread_t ts[3]; int i; for (i = 0; i < 3; i++) ts[i] = st_thread_create(&f, NULL, 1, 0); // h(0); // I get a seg fault here if I uncomment this. for (i = 0; i < 3; i++) st_thread_join(ts[i], NULL); return 0; } but it prints out nothing (except for a correct thread count): 5 thread(s) with this backtrace: 5 thread(s) with this backtrace: 5 thread(s) with this backtrace: -- Yang Zhang http://www.mit.edu/~y_z/ |