Web lists-archives.com

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

     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()
                 // 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:
final link failed: File truncated

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

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

MinGW-users mailing list

This list observes the Etiquette found at 
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:
Also: mailto:mingw-users-request@xxxxxxxxxxxxxxxxxxxxx?subject=unsubscribe