Article View: comp.lang.objective-c
Article #390Undefined reference?
From: Niko
Date: Tue, 13 Mar 2001 22:54
Date: Tue, 13 Mar 2001 22:54
42 lines
2964 bytes
2964 bytes
Hie, I have to learn Objective C but I have a problem with compiling... - I use GCC v2.95.2 provided by Suse Linux 7.0 with GCC-objc v2.95.2 provided by the ftp site of suse, both are rpms (installed with default paths I suppose). - I have checked : both libraries are located at /usr/lib/gcc-lib/i486-suse-linux/2.95.2/* - I have tried to compile a very simple program : an object oriented "hello World" found on dekorte.com (called "printer") I have just added the flag -Wno-import . - I have found a similar message posted two years ago in gnu.gcc.help which explains the same problem : but there is not any answer. Please help me I don't know why I get the following output : $ gcc -lobjc -Wno-import printer.m main.m -o test /tmp/ccEGLqk1.o: In function `main': /tmp/ccEGLqk1.o(.text+0x28): undefined reference to `objc_get_class' /tmp/ccEGLqk1.o(.text+0x33): undefined reference to `objc_msg_lookup' /tmp/ccEGLqk1.o(.text+0x4b): undefined reference to `objc_msg_lookup' /tmp/ccEGLqk1.o(.text+0x74): undefined reference to `objc_msg_lookup' /tmp/ccEGLqk1.o(.text+0xa3): undefined reference to `objc_msg_lookup' /tmp/ccEGLqk1.o(.text+0xd0): undefined reference to `objc_msg_lookup' /tmp/ccEGLqk1.o: In function `global constructors keyed to main': /tmp/ccEGLqk1.o(.text+0x10f): undefined reference to `__objc_exec_class' /tmp/ccItBWR8.o: In function `_i_Printer__init': /tmp/ccItBWR8.o(.text+0x26): undefined reference to `objc_msg_lookup_super' /tmp/ccItBWR8.o(.text+0x4d): undefined reference to `objc_msg_lookup' /tmp/ccItBWR8.o: In function `_i_Printer__print': /tmp/ccItBWR8.o(.text+0xde): undefined reference to `objc_msg_lookup' /tmp/ccItBWR8.o: In function `global constructors keyed to printer.mzUov8d': /tmp/ccItBWR8.o(.text+0x13f): undefined reference to `__objc_exec_class' /tmp/ccItBWR8.o(.rodata+0x8): undefined reference to `__objc_class_name_Object' collect2: ld returned 1 exit status
Technical Details
Message-ID:
<699tat8g64nd10muf5cih1irqvl25ndcm5@4ax.com>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!freenix!proxad.net!feeder2.proxad.net!nnrp1.proxad.net.POSTED!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,30b34a1e2f9e1e50,start X-Google-Attributes: gid11318c,public X-Google-Thread: 1111a3,30b34a1e2f9e1e50,start X-Google-Attributes: gid1111a3,public X-Google-ArrivalTime: 2001-03-13 14:56:03 PST Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!freenix!proxad.net!feeder2.proxad.net!nnrp1.proxad.net.POSTED!not-for-mail From: Niko <use@reply.to> Newsgroups: comp.lang.objective-c,gnu.gcc.help Subject: Undefined reference? Reply-To: nikolee@free.fr Message-ID: <699tat8g64nd10muf5cih1irqvl25ndcm5@4ax.com> X-Newsreader: Forte Agent 1.8/32.548 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 43 Date: Tue, 13 Mar 2001 22:54:06 GMT NNTP-Posting-Host: 213.228.9.199 X-Complaints-To: abuse@proxad.net X-Trace: nnrp1.proxad.net 984524046 213.228.9.199 (Tue, 13 Mar 2001 23:54:06 MET) NNTP-Posting-Date: Tue, 13 Mar 2001 23:54:06 MET Organization: Guest of ProXad - France