【问题标题】:@ sign at the end of symbol name in object file@ 符号在目标文件中符号名称的末尾
【发布时间】:2012-08-13 10:33:28
【问题描述】:

在我的系统jpeg库中说:

$ > nm libjpeg.a | grep jpeg_finish_decompress
00000510 T _jpeg_finish_decompress

但在 openjpeg 库中:

$ > nm lib/libopenjpeg.a | grep opj_decode_with_info
00000240 T _opj_decode_with_info@12

后者末尾有@12。我猜 12 是参数的总大小。
然而为什么有些符号有@-结尾? 当我尝试编译 mupdf 库时,问题就出现了。它可以与 jpeg 链接 例如库,但无法再次链接 openjpeg。

【问题讨论】:

    标签: linker cygwin mingw symbols


    【解决方案1】:

    简短的回答是名称修改。它甚至用于纯 c 代码,而不仅仅是 c++。

    下一个例子来自wikipedia。下一个函数定义:

    int _cdecl    f (int x) { return 0; }
    int _stdcall  g (int y) { return 0; }
    int _fastcall h (int z) { return 0; }
    

    给出这些符号:

    _f
    _g@4
    @h@4
    

    【讨论】: