sumit
12/25/2019 - 8:02 AM

LIBS in Makefile, linking .so, .a libraries in Makefile

1. Name all installation path where particular package is located

dpkg -L packagename

2. Adding Lib to Makefile

IIR_LIB_INSTALL_DIR is the path where libiir.so file locates
IIR_LIB_INSTALL_DIR=/usr/lib/aarch64-linux-gnu
LIBS+= -L$(IIR_LIB_INSTALL_DIR) -liir

if libiir.so file is not located then use to linked version file "libiir.so.1.7.4" of lib file to "libiir.so" sudo ln -s /usr/lib/aarch64-linux-gnu/libiir.so.1.7.4 /usr/lib/aarch64-linux-gnu/libiir.so

LINKING NEW LIBRARIES

getting debugging error of

/usr/bin/ld: cannot find -liir, collect2: error: ld returned 1 exit status

ld -lzlib --verbose

3. Sometimes library defined functions are only available in the .so file so you have to add .so lib in Makefile and also do -I to the coding files .h and .cpp