2012-08-13 29 views
0

说,在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 [email protected] 

后者有@ 12月末。我猜12是参数的总大小。
尽管如此,为什么一些符号有@结束? 当我试图编译mupdf库时,出现了这个问题。它链接确定与例如jpeg 库,但未能链接重新openjpeg。

回答

0

简短的回答是名称mangling。它甚至用于普通的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 
[email protected] 
@[email protected]