I am making a C++ library. In the library, I am using some functions in another static library (e.g. ref.a).
I want to generate one library file, either mylib.a or mylib.so, so that any program using my library does not need to link to the static library (ref.a). I got some ideas from others how to link static lib into dynamic lib, like "--whole-archive", but not so clear how to do it.
To get mylib.a, I just ar -rc mylib.a mylib.o ref.a (may not be a standard way). What about a shared lib, e.g. mylib.so?