On 2005-11-14 00:44, Marc Argent <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am trying to compile a very simple Objective C program (actually, it
> is a 'Hello World' test program with a different file extension and
> linked to the Objective C library).
>
> #import <stdio.h>
>
> int main (int argc, const char *argv[])
> {
>       printf("Hello World\n");
>       return 0;
> }
>
> I am invoking the compiler with the following line:
>
> gcc main.m -o helloworld -l objc
>
> This results in the following error message:
>
> /usr/lib/libobjc.so: undefined reference to `pthread_attr_destroy'
> /usr/lib/libobjc.so: undefined reference to `pthread_create'
> /usr/lib/libobjc.so: undefined reference to `pthread_attr_init'
> /usr/lib/libobjc.so: undefined reference to `pthread_exit'
> /usr/lib/libobjc.so: undefined reference to `pthread_getschedparam'
> /usr/lib/libobjc.so: undefined reference to `pthread_setschedparam'
> /usr/lib/libobjc.so: undefined reference to `pthread_attr_setdetachstate'

First of all, remove the space after -l.

Then add -lpthread to the libraries you link to and see if that helps.

_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to