I created a .so file and put it in the location /opt/lib and added this path to LD_LIBRARY_PATH now after this when I try to compile m
.so
/opt/lib
LD_LIBRARY_PATH
@Alwin Doss You should provide the -L option before -l. You would have done the other way round probably. Try this :)