How to build single .o file from multiple .o files

Submitted by Anonymous
on February 28, 2006 - 2:11pm

Man Pages

BitShifter (not verified)
on
February 28, 2006 - 3:28pm

man and info pages for the tools ar, ld, gcc, g++ etc are very helpful. Assuming that you just want a larger object file to link against later, what you probably want is an archive file.

The command would be:

ar archivename.a object1.o object2.o objectn.o

you can then use the archive to link your final binary against.

ld -r is your friend.

Anonymous (not verified)
on
February 28, 2006 - 6:49pm

ld -r is your friend.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.