HOME       >>       Programming

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


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?


Xisto.com offers Free Web Hosting to its Members for their participation in this Community. We moderate all content posted here but we cannot warrant full correctness of all content. While using this site, you agree to have read and accepted our terms of use, cookie and privacy policy. Copyright 2001-2019 by Xisto Corporation. All Rights Reserved.