Article View: comp.lang.objective-c
Article #399Re: Help with compiling Objc using gcc
From: Alan L. Liu
Date: Sat, 22 Nov 1997 00:00
Date: Sat, 22 Nov 1997 00:00
36 lines
2213 bytes
2213 bytes
Upon help from all over via email (thanks everyone who tried to help), I've gotten a step closer to actually getting the blasted program to compile. Still, it refuses and does this: someprompt> gcc -o test -Wno-import main.m Printer.m -lobjc /usr/lib/gcc-lib/i486-linux/2.7.2.1/libobjc.a(thr-posix.o): In function `__objc_init_thread_system': thr-posix.o(.text+0x3b): undefined reference to `pthread_key_create' /usr/lib/gcc-lib/i486-linux/2.7.2.1/libobjc.a(thr-posix.o): In function `objc_thread_create': thr-posix.o(.text+0x95): undefined reference to `pthread_create' thr-posix.o(.text+0xa5): undefined reference to `pthread_detach' /usr/lib/gcc-lib/i486-linux/2.7.2.1/libobjc.a(thr-posix.o): In function `objc_thread_exit': thr-posix.o(.text+0x125): undefined reference to `pthread_exit' /usr/lib/gcc-lib/i486-linux/2.7.2.1/libobjc.a(thr-posix.o): In function `objc_thread_set_data': thr-posix.o(.text+0x14e): undefined reference to `pthread_setspecific' /usr/lib/gcc-lib/i486-linux/2.7.2.1/libobjc.a(thr-posix.o): In function `objc_thread_get_data': thr-posix.o(.text+0x17a): undefined reference to `pthread_getspecific' /usr/lib/gcc-lib/i486-linux/2.7.2.1/libobjc.a(thr-posix.o): In function `objc_mutex_trylock': thr-posix.o(.text+0x2b5): undefined reference to `pthread_mutex_trylock' someprompt> I tried using both the -I option and the -L option to no avail. I searched for files containing the string "pthread" and got two directories: /usr/include and /usr/lib, but I don't know if the files pertaining to the errors are in those, nor the correct order of flags to use to tell gcc how to recognize the libraries. :( -- Alan Liu surak@imsa.edu
Technical Details
Message-ID:
<65597m$mi1$1@java.imsa.edu>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<64v4m2$8l4$1@java.imsa.edu>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,f5ad7c554583d853 X-Google-Attributes: gid11318c,public X-Google-Thread: 1111a3,f5ad7c554583d853 X-Google-Attributes: gid1111a3,public From: Alan L. Liu <surak@imsa.edu> Subject: Re: Help with compiling Objc using gcc Date: 1997/11/22 Message-ID: <65597m$mi1$1@java.imsa.edu> X-Deja-AN: 291440000 References: <64v4m2$8l4$1@java.imsa.edu> Organization: Illinois Mathematics and Science Academy Newsgroups: comp.lang.objective-c,gnu.gcc.help