C++ G711编码解码器错误

标签 c++ function build-error

我在 C++ ( Visual Studio 2013 ) 中有以下代码来在头文件中声明函数原型(prototype):

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

编译器返回以下错误:

error C2062: type 'short' unexpected

我做错了什么?

最佳答案

MSDN says : “将 __cdecl 修饰符放在变量或函数名称之前。”

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

关于C++ G711编码解码器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34680587/

相关文章:

c++ - 自动提交被禁用并且永远不会回滚会发生什么?

php - 全局 vs 函数 vs 静态类方法

c# - IKVM 和 System.Core System.Runtime.CompilerServices.ExtensionAttribute

c++ - QtCreator : process jom. exe 退出,代码为 3

c++ - 如何优化C++程序运行MPI?

c++ - 如何让QT Application写入崩溃日志

C++如何从用户输入中读取第一个字符并忽略其余部分(字符类型)

java - 在 Java 中使用函数指针作为简单的命令行解释器

r - 在 R 中使用 fitdist 时出错 - 必须定义 dllogis 函数

java - 是什么导致 Eclipse 中导入的 Maven 项目默认使用 Java 1.5 而不是 Java 1.6,我如何确保它不使用?