and with the last 4.0.0 version I tried, there is another problem already in the configure step (because gcc-4.0.0 can't link properly an Objective-C program that has a .c extension).â otherwise why not replace the .c extension by .m ?
It's the configure script (of gnustep-base) which constructs a file named (I believe) conftest.c in which is included the Objective-C file config/config.objc.m .
I described the problem on gcc-help mailing list but got no answer. I can reproduce the text of my messages here :
------------------------------------------------------------- 1 ------
Let's name an Objective-C program main.m :
> gcc main.m -lobjc ...works fine.
If we name the very same program main.c :
> gcc -x objective-c main.c -lobjc
...gives :
/usr/local/lib/gcc/powerpc-unknown-linux-gnu/4.0.0/../../../../powerpc-unknown-linux-gnu/bin/ld: a.out: hidden symbol `_Unwind_GetIP' in /usr/local/lib/gcc/powerpc-unknown-linux-gnu/4.0.0/libgcc_eh.a(unwind-dw2.o) is referenced by DSO
collect2: ld returned 1 exit status
Then if I take the same main.m and process it in 2 steps :
> gcc -c main.m ...works fine
> gcc main.o -lobjc ...gives the same error message
Af far as I can tell, those problems did not show up with gcc-3.4.x . If you have any idea about the problem and/or the solution...
NB: gcc is 4.0.0 20050213
computer is an Apple powerpc running Linux 2.4.16NB2: the computer on which I ran the tests is not the same as this one I use to write this e-mail, so I typed the error message with my little fingers, which means there can/will be copying errors.
NB3: I have a very small example program if you ask for it, and please ask for any piece of information that you think would be useful.
---------------------------------------------------------------------- ------------------------------------------------------------- 2 ------ With gcc -v, I can see :
> Let's name an Objective-C program main.m : > > gcc main.m -lobjc > ...works fine.
collect2 is called with libraries : -lobjc -lgcc_s -lgcc -lc
> If we name the very same program main.c : > > gcc -x objective-c main.c -lobjc
collect2 is called with libraries : -lobjc -lgcc_eh -lgcc -lc
So, if I add now this libgcc_s :
>gcc -x objective-c main.c -lobjc -lgcc_s ... works fine !
What are those libraries (libgcc_s, libgcc_eh) ?
Why does gcc try to link with different libraries just because the file extension is different ?
Why does now (4.0.0) libgcc_eh depend on libgcc_s ? (This is not the case with a gcc-3.4.x).
----------------------------------------------------------------------
Goodbye,
StÃphane Goujet.
_______________________________________________ Discuss-gnustep mailing list [email protected] http://lists.gnu.org/mailman/listinfo/discuss-gnustep
