Cannot link objc programs with gcc 4.4.0 on mingw

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux