【问题标题】:How to get name of dynamically loaded library in linux from within the library that has been opened using ::dlopen?如何从使用 ::dlopen 打开的库中获取 linux 中动态加载的库的名称?
【发布时间】:2012-05-05 12:48:11
【问题描述】:

在 windows 中可以使用 GetModuleFileName。 linux呢?

【问题讨论】:

    标签: c++ linux dynamic shared-libraries


    【解决方案1】:

    dladdr() 是一个非标准(不是 POSIX 的一部分)函数,适用于大多数 Linux 机器和 OSX。由于它是非标准的,因此无法保证,但既然您指定了 Linux,它就应该存在。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-11-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-06-18
      • 1970-01-01
      • 2020-02-27
      • 2010-12-06
      相关资源
      最近更新 更多