t-thirupathi / Cpp-shared-library

Creating and using shared library in C++ - Sample program

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Creating and using shared library in C++ - Sample program

1) To compile and create binary, do 
    i) /bin/make
Now there will two files created. libfunction.so and a.out

2) To check what libraries a.out dynamically loads, do 
    i) ldd a.out
Now libfunction.so may show as "not found". 
This is because libfunction.so library is not present in a directory which will be checked by the dynamic linker. 
This can be fixed by either copying libfunction.so to a standard library directory, or by modifying that standard library path as below.
    i) export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH

3) To run the binary, do 
    i) ./a.out

About

Creating and using shared library in C++ - Sample program


Languages

Language:C++ 73.1%Language:Makefile 26.9%