开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜