简体   繁体   English

C ++ G711编码器解码器错误

[英]C++ G711 encoder decoder error

I have the following code in C++ ( Visual Studio 2013 ) to declare a function prototype in a header file: 我在C ++(Visual Studio 2013)中具有以下代码以在头文件中声明函数原型:

extern "C" __cdecl
short int
G_Init(
 void *Ptr,
 char Encoding);

and the compiler returns the following error: 并且编译器返回以下错误:

error C2062: type 'short' unexpected

What I'm doing wrong ? 我做错了什么?

MSDN says : "Place the __cdecl modifier before a variable or a function name ." MSDN说“将__cdecl修饰符放在变量或函数名称之前 。”

That is, extern "C" short int __cdecl G_Init , not extern "C" __cdecl short int G_Init . 也就是说, extern "C" short int __cdecl G_Init ,而不是extern "C" __cdecl short int G_Init

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM