I have 2 object files (*.o
) and one static library (*.a
) using g++
How to link these files and become 1 object file (*.o
)?
Please advice…thanks.
This is one (rare) case where you shouldn't be using g++
. Use ld
directly:
ld -r -o combined.o foo.o bar.o libxyz.a
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With