This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Cannot link objc programs with gcc 4.4.0 on mingw
- From: Ronald Pijnacker <pijnacker at dse dot nl>
- To: gcc-help at gcc dot gnu dot org
- Cc: Ronald Pijnacker <pijnacker at dse dot nl>
- Date: Fri, 17 Jul 2009 08:56:27 +0200
- Subject: Cannot link objc programs with gcc 4.4.0 on mingw
Hi all,
I just installed gcc 4.4.0 on my msys/mingw system, downloaded
from https://sourceforge.net/projects/mingw/files/.
With it I cannot even link the simples objc program:
=== simple.m
#import <objc/Object.h>
int
main()
{
id obj = [Object new];
[obj free];
return(0);
}
===
When I compile this with gcc 3.4.5
$ gcc -o simple simple.m -lobjc
it's ok. Also, gcc 4.4.0 on linux seems fine.
The same command on 4.4.0 mingw fails:
$ gcc -o simple simple.m -lobjc
C:\Temp\ccSRaVzS.o:simple.m:(.text+0x17): undefined reference to `objc_get_class'
C:\Temp\ccSRaVzS.o:simple.m:(.text+0x2a): undefined reference to `objc_msg_lookup'
C:\Temp\ccSRaVzS.o:simple.m:(.text+0x51): undefined reference to `objc_msg_lookup'
C:\Temp\ccSRaVzS.o:simple.m:(.text+0x7c): undefined reference to `__objc_exec_class'
C:\Temp\ccSRaVzS.o:simple.m:(.data+0x4c): undefined reference to `__objc_class_name_Object'
collect2: ld returned 1 exit status
I checked libobjc.a and libobjc.dll.a with nm, and they seem to provide these symbols.
Any thoughts?
Thanks,
Ronald