Jump to content
xisto Community
Sign in to follow this  
Vyoma

[c/c++][linux] Linking With A -l Is Static Or Dynamic? How will it effect distribution and portability?

Recommended Posts

It has been a long time since I coded in C/C++ and I can't seem to remember the exact mechanism of linking.

 

Say, I compiled and linked the source code given at SQLite quickstart guide (C example in Write Programs That Use SQLite) in Linux(Ubuntu) environment:

 

g++ -o"SQLiteTest" ./sqlitetest.o -lsqlite3

 

It gives me a nice executable SQLiteTest and I can use it on my system.

 

But how would it fare when I distribute that code to someone else? Is the libsqlite3.* statically packaged into SQLiteTest? or is it dynamically linked and the recipient of the program need to download the SQLite3 libraries?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.