English 中文(简体)
• 防止名字被搁置
原标题:Can t prevent name mangling

我正试图用C语写成批号,其他方案也将用C语进口。

因此,批次出口的所有功能均在无批发号的上界定,“无批发号”(出口)”(保留)。 我只用出口科和我想要出口的职能的名称(名称)。

I am using vc71/vs2003 to build this and I am still getting mangled names (which I can see if I open the .lib in notepad). Also just for clarification, visual studio causes name mangling in C code as well (most resources I could find mentioned it being an issue with only C++).

How can I prevent this name mangling?

Further Information:

单角名称为功能Name@integer,其中按字体表示参数(而不是按字母)。 例如,

From .lib: _PrepareSeverResponse@8

Function declaration in .h: char* PrepareSeverResponse(unsigned int* size ,handshake* ws_handshake);

.def: EXPORTS PrepareSeverResponse

Calling Convention: __stdcall(/Gz)

Hope this makes it clearer.

最佳回答

改变呼吁公约为我工作。 前面的“C”解决办法给我带来了很多帮助,正如在我的案件中,问题在于在汇编时名声。 C 档案,如果我正确理解,“C”解决办法就是在汇编申请档案时压制名人。

问题回答

为了防止名字拼凑,你需要把标题打上<代码>extern C:

#ifdef __cplusplus
extern "C" {
#endif


//  Headers


#ifdef __cplusplus
}
#endif

这将把符号用到其C型(unmangled)名上。

在不见你所说的“名称-所有权”的情况下,我会猜测,你必须设立视觉演播室,以<条码>作为《C法典》(。

载于<代码>Properties->C/C++->Advanced->Compile As。 你可以选择这一环境,来选择整个项目,因为你打算这样做。





相关问题
Fastest method for running a binary search on a file in C?

For example, let s say I want to find a particular word or number in a file. The contents are in sorted order (obviously). Since I want to run a binary search on the file, it seems like a real waste ...

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

Tips for debugging a made-for-linux application on windows?

I m trying to find the source of a bug I have found in an open-source application. I have managed to get a build up and running on my Windows machine, but I m having trouble finding the spot in the ...

Trying to split by two delimiters and it doesn t work - C

I wrote below code to readin line by line from stdin ex. city=Boston;city=New York;city=Chicago and then split each line by ; delimiter and print each record. Then in yet another loop I try to ...

Good, free, easy-to-use C graphics libraries? [closed]

I was wondering if there were any good free graphics libraries for C that are easy to use? It s for plotting 2d and 3d graphs and then saving to a file. It s on a Linux system and there s no gnuplot ...

Encoding, decoding an integer to a char array

Please note that this is not homework and i did search before starting this new thread. I got Store an int in a char array? I was looking for an answer but didn t get any satisfactory answer in the ...

热门标签