solotim
solotim

Reputation: 1866

What's the difference between link libstdc++ statically and link libstdc++.a

all. I've read this article before I asked this question:Linking libstdc++ statically

I just can not understand his explaination of why linking statically simplye not ganna work. Can anybody here help me out? (since orignial blog feedback is closed, I can't help but asking here)

Upvotes: 2

Views: 1685

Answers (2)

R Samuel Klatchko
R Samuel Klatchko

Reputation: 76581

It doesn't say that linking libstdc++ statically will not work.

It says that if you want to link libstdc++ statically, you need to link all of your C++ code statically as well.

Upvotes: 1

dendryte
dendryte

Reputation: 221

The stdc++ you statically link with and the stdc++ that the dynamically-linked libraries use when your program is run may be incompatible. If you dynamically link, then the stdc++ used in both cases will be the one and same.

Linking to libstdc++.a directly is statically linking to it. You just have to be aware of the caveats due to version incompatibility mentioned in the article.

Upvotes: 1

Related Questions