EMF文件(.so)调试,符号未找到VTable错误

发布于 2024-12-26 09:49:02 字数 704 浏览 9 评论 0原文

在 Solaris 中,我有一个 exe 文件,根据指南,我需要添加共享库 (.so) 来扩展功能。我创建了一个 lthmyplugin.so 文件并按所述添加。现在该实用程序运行得很好,直到它调用我的函数,调用我的函数后它失败了。

提问:

  1. 有什么办法可以调试吗?
  2. 当我运行命令 truss 时,它识别 aa.so

也 ldd -d lthmyplugin.so 显示没有错误,除了

    symbol not found: __1cIMyPluginG__vtbl_         (./lthmyplugin.so)    
    symbol not found: __1cIThPluginG__vtbl_         (./lthmyplugin.so)    
    symbol not found: __1cOThLocalOptionsG__vtbl_           (./lthmyplugin.so)    
    symbol not found: __1cJThOptionsG__vtbl_                (./lthmyplugin.so)     

这会导致程序失败吗?

仅供参考,我没有使用过任何虚函数、构造函数或析构函数,

这意味着什么符号未找到:_1cIThPluginG_vtbl_?

谢谢,

In Solaris I have an exe file as per the guideline I need to add a shared library (.so) to extend the functionality. I have created a lthmyplugin.so file and added as described. Now the utlity run perfectly fine untill it calls my function After calling my function it fails.

Questions:

  1. Is there any way to debug?
  2. When I run the command truss it identifies aa.so

Also ldd -d lthmyplugin.so show no error except

    symbol not found: __1cIMyPluginG__vtbl_         (./lthmyplugin.so)    
    symbol not found: __1cIThPluginG__vtbl_         (./lthmyplugin.so)    
    symbol not found: __1cOThLocalOptionsG__vtbl_           (./lthmyplugin.so)    
    symbol not found: __1cJThOptionsG__vtbl_                (./lthmyplugin.so)     

Can this cause the programme to fail?

fyi, I have not used and any virtual function,constructors or destructors

What does this mean symbol not found: _1cIThPluginG_vtbl_ ?

Thanks,

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

橘味果▽酱 2025-01-02 09:49:02

您可以使用nm工具查看so文件公开的函数。您可以调用:

nm -g lthmyplugin.so

...来查看它公开了哪些功能。

除此之外,鉴于您已将其标记为 C++,我将尝试询问:您是否指定了 C 风格调用约定?如果你不这样做,它就会破坏这些名字,使它们变得丑陋、难以阅读,并且在 99.9% 的情况下,无法找到。您可以通过添加 __attribute__((cdecl)) 告诉 gcc 不要破坏您的函数,如下所示:

int not_mangled(int some_arg) __attribute__((cdecl))
{
    return some_arg * 3;
}

You can use the nm tool to see the functions exposed by the so file. You can call:

nm -g lthmyplugin.so

... To see what functionality it exposes.

Besides that, given you've tagged this as C++, I'm going to take a stab and ask: did you specify a C style calling convention? If you didn't, it will mangle the names making them ugly, unreadable and in 99.9% of cases, unfindable. You can tell gcc not to mangle your functions by adding __attribute__((cdecl)), like so:

int not_mangled(int some_arg) __attribute__((cdecl))
{
    return some_arg * 3;
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文