I met some problem about pthread. I wrote a cgo demo which use some pthread_* function, but it compile failed
ccode.c ``` # include <stdio.h> # include "ccode.h" # include <pthread.h> int try_pthread(){ pthread_t id; int ret, i = 0; ret = pthread_create(&id,NULL,(void *)thread,NULL); for(i=0;i<=5;i++) printf("This is main thread %d\n",i); pthread_join(id,NULL); pthread_once(id, NULL); return 0; } void thread() { int i=0; for(i=0;i<=5;i++) printf("this is thread %d\n",i); } ``` main.go ``` package main /* #cgo CFLAGS: -I./ #cgo LDFLAGS: -L./ #include "ccode.h" */ import "C" func main() { _ = C.try_pthread() } ``` the `pthread_create` can be searched, but the other two functions report this: ccode.c:11: error: undefined reference to 'pthread_join' ccode.c:12: error: undefined reference to 'pthread_once' -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/420b877a-0e55-4b53-866a-f539ec80c999n%40googlegroups.com.