[cfe-dev] Get the actual name of a library from its file

陈志伟 via cfe-dev cfe-dev at lists.llvm.org
Sun Nov 29 19:34:43 PST 2020


> On Nov 23, 2020, at 3:39 AM, Dimitar Dobrev via cfe-dev <cfe-dev at lists.llvm.org> wrote:
> 
> I'm looking for a function in Clang/LLVM which can get me the actual 
> name of a library from its file. For example, if I have a file called 
> "libtest.so.1.0.1", I'd like to get "test". You can think of it as the 
> name of the library required for passing to a linker.


libtest.so.1.0.1 should not be used directly. Instead create a symbol link to it (named libtest.so) and then pass -ltest to linker.

--
Zhiwei Chen


More information about the cfe-dev mailing list