I am building my project in C++. I have these two libraries: shared_lib1 and static_lib2. Both have a function with the same name as func(). Only func() in static_lib2 has an assert statement. shared_lib1 is a shared library and static_lib2 is a static library.
and lib3 has dependency on shared_lib1.
I can't change any of these two libs: shared_lib1, static_lib2, because they are third-party libraries. lib3 is available either as a dynamic library or a static library.
I use lib3 as a shared library: shared_lib3. When this shared_lib3 was built, ldd command shows its dependency on shared_lib1. So I think shared_lib3 should use func() in shared_lib1.
In my project, it links to both shared_lib3 and static_lib2, and src1.cpp calls a function func3() in shared_lib3, which is supposed to call func() in shared_lib1, but the program aborted with a core dump and the backtrace shows it aborted because of the assert statement in func() from static_lib2.