This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

newbie of Obj-C


I'm trying to learn Objective-C but can't seem to get a simple program to compile.  I copied it from a college web site so I assume it's written correctly.  After compiling each implementation file like this:

gcc -c -Wno-import (.m file)


I then try to link all of the implementations like this:

gcc -Wno-import (.o files) -lobjc


but instead of an a.out I get this:


/usr/lib/gcc-lib/i386-linux/2.95.2/libobjc.a(thr-posix.o): In function `__objc_init_thread_system':
thr-posix.o(.text+0x41): undefined reference to `pthread_key_create'
/usr/lib/gcc-lib/i386-linux/2.95.2/libobjc.a(thr-posix.o): In function `__objc_thread_detach':
thr-posix.o(.text+0x79): undefined reference to `pthread_create'
/usr/lib/gcc-lib/i386-linux/2.95.2/libobjc.a(thr-posix.o): In function `__objc_thread_set_data':
thr-posix.o(.text+0x128): undefined reference to `pthread_setspecific'
/usr/lib/gcc-lib/i386-linux/2.95.2/libobjc.a(thr-posix.o): In function `__objc_thread_get_data':
thr-posix.o(.text+0x148): undefined reference to `pthread_getspecific'
/usr/lib/gcc-lib/i386-linux/2.95.2/libobjc.a(thr-posix.o): In function `__objc_mutex_trylock':
thr-posix.o(.text+0x235): undefined reference to `pthread_mutex_trylock'
collect2: ld returned 1 exit status


Now I've done some simple C and C++ programming on this machine before (no problem compiling them) but I have no idea what these errors are about.  I'm running Debian 2.2R6 and installed the Objective-C development packages but I suspect I still may not have everything set up right.  Much appreciation for anyone who can guide me in the right direction toward getting this to work.  Thanks

Ben



__________________________________________________________________
Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with Shop@Netscape! http://shopnow.netscape.com/

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]