Diff in gplc on Mac OS X and Linux (kernel 3.5)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Diff in gplc on Mac OS X and Linux (kernel 3.5)

daveti
Hi there,

I may run into a weird issue related with gplc compiler. The command line below works well for Mac OS X but fails in Linux (failing in linking...)

gplc --c-compiler gcc -L '-lpthread' -o gqicwt gqicwt.pl gqicwt.c

I bet the usage of gplc is right but....

Thanks,
Dave


Linux~
root@arpsec01:~/cgpic/master/gqicwt# gplc --c-compiler gcc -L '-lpthread' -o gqicwt gqicwt.pl gqicwt.c
gqicwt.c: In function 'main':
gqicwt.c:102:2: warning: passing argument 3 of 'pthread_create' from incompatible pointer type [enabled by default]
/usr/include/pthread.h:225:12: note: expected 'void * (*)(void *)' but argument is of type 'void (*)(void *)'
/tmp/gplcNfnaJh.o: In function `main':
gqicwt.c:(.text+0x284): undefined reference to `pthread_create'
gqicwt.c:(.text+0x2d8): undefined reference to `pthread_join'
collect2: ld returned 1 exit status
compilation failed
root@arpsec01:~/cgpic/master/gqicwt#

Reply | Threaded
Open this post in threaded view
|

Re: Diff in gplc on Mac OS X and Linux (kernel 3.5)

daveti
Well, it seems there is nothing wrong with the gplc....
Just found a Linux machine which could compile the code with -lpthread....
Then there should be some LD_LIBRARY_PATH or env issue on the previous Linux machine....
Still debugging....
Reply | Threaded
Open this post in threaded view
|

Re: Diff in gplc on Mac OS X and Linux (kernel 3.5)

daveti
Fixed - caused by the wrong order of passing linking parameters in gcc....

-daveti