Re: FreeBSD 6.0 and Objective C

2005-11-13 Thread James Bailie

Marc Argent wrote:


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'


Try adding -lpthread to the compiler command line?


--
James Bailie [EMAIL PROTECTED]
http://www.jamesbailie.com
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: FreeBSD 6.0 and Objective C

2005-11-13 Thread Giorgos Keramidas
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]


Re: FreeBSD 6.0 and Objective C

2005-11-13 Thread Dinesh Nair



On 11/14/05 08:50 James Bailie said the following:

Try adding -lpthread to the compiler command line?


actually -pthread would be better. not the missing el ('l').

--
Regards,   /\_/\   All dogs go to heaven.
[EMAIL PROTECTED](0 0)http://www.alphaque.com/
+==oOO--(_)--OOo==+
| for a in past present future; do|
|   for b in clients employers associates relatives neighbours pets; do   |
|   echo The opinions here in no way reflect the opinions of my $a $b.  |
| done; done  |
+=+
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: FreeBSD 6.0 and Objective C

2005-11-13 Thread Chad Leigh -- Shire.Net LLC


On Nov 13, 2005, at 8:11 PM, Dinesh Nair wrote:




On 11/14/05 08:50 James Bailie said the following:

Try adding -lpthread to the compiler command line?


actually -pthread would be better. not the missing el ('l').


I have a question about this (or similar solutions), as I hope to do  
some Objective-C programming soon with SOPE http:// 
sope.opengroupware.org/index.html.  If the Objective-C library  
requires pthreads, why does not the Objective-C library already  
contain the references to that library?  It seems rather strange to  
me that system library dependencies have to be manually met in my own  
compile statements...


Chad


---
Chad Leigh -- Shire.Net LLC
Your Web App and Email hosting provider
[EMAIL PROTECTED]


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