I have a C++ based project(many source files) compiled using gnu make via a makefile. I have an application which links a library, say mylib. Now mylib is owned by some other developer. I see 2 files present in the path where the library binaries are generated namely libmylib.so (shared object) and libmylib.a (static library archive file)
My application makefile has below linker option to link the library mylib
LDFLAGS+=-l:mylib ...
Question is what version of the library mylib would be linked in my application executable
Would the shared object libmylib.so or static version libmylib.a ?
How would it be decided, would there be any other makefile option to govern this?
gcc
defaults to dynamic unless-static
is specified. – user529758 Feb 6 '13 at 14:22