开发者

How to link object file (*.o) and static library file (*.a)

开发者 https://www.devze.com 2023-03-07 12:39 出处:网络
I have 2 object files (*.o) and one static library (*.a) using g++ How to link these files and become 1 开发者_JAVA技巧object file (*.o)?

I have 2 object files (*.o) and one static library (*.a) using g++ How to link these files and become 1 开发者_JAVA技巧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
0

精彩评论

暂无评论...
验证码 换一张
取 消