Web lists-archives.com

[Mingw-users] Can't do partial linking with libmoldname.a?




Hello,
     I'm trying to do partial linking a .o file with libmoldname.a, the 
partial linking is OK, but when I linking the generated .o to .exe, the 
linking failed. Here are my steps:
     I have a C source file, test.c, with the following code:
         #include <stdio.h>
         #include <string.h>
         int main()
         {
             puts(strdup("hello"));
                 // strdup() is in libmoldname.a
             return 0;
         }
     Compile the C code (success):
         gcc -c -o test.o test.c
         Partial linking (success):
         ld -o big.o -r test.o /mingw/lib/libmoldname.a
     Finally, link to generate EXE file (failed):
         gcc -o test.exe big.o
     The error message is:
 
c:/mingw/bin/../lib/gcc/mingw32/5.3.0/../../../../mingw32/bin/ld.exe: 
final link failed: File truncated

     Is this a bug? Or the libmoldname.a can't be partial linked?

--
Regards,
Zhang Boyang
School of Computer Science, Fudan University, P.R.China

------------------------------------------------------------------------------
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:mingw-users-request@xxxxxxxxxxxxxxxxxxxxx?subject=unsubscribe