' BYTE'没有命名类型|| ' BOOL'尚未宣布

时间:2016-07-16 13:49:49

标签: c++ visual-studio gcc compiler-errors g++

当我跑" g ++"制作JNI我得到了#34;没有命名类型"错误。

g++ -shared -o finger.dll FingerPrintJNI.c

以下是错误消息

In file included from FingerPrintJNI.c:4:0:

IMM64.h:21:2: error: 'BYTE' does not name a type
BYTE Data[MAX_FEATUREVECT_LEN];
^~~~

IMM64.h:26:2: error: 'BYTE' does not name a type
BYTE Data[MAX_INDEXINFO_LEN];
^~~~

IMM64.h:31:2: error: 'BYTE' does not name a type
BYTE Data[MAX_INDEXINFO_LEN_1];
^~~~

IMM64.h:44:2: error: 'BYTE' does not name a type
BYTE kind;
^~~~

IMM64.h:55:2: error: 'BYTE' does not name a type
BYTE kind;
^~~~

IMM64.h:73:2: error: 'BOOL' has not been declared
BOOL *bResult, unsigned int *uiMatchScore, unsigned int *uiHit, Pair_t *hCPairs = NULL);

头文件看起来像这样。 (由于安全原因,我无法共享整个代码)

XXX_API char * __stdcall XXXXDCI_GetVer();

以下是问题。

  1. " BYTE"已被声明为大写。 它与Visual Studio有关吗?

  2. 头文件有" __ stdcall"。这是否意味着头文件是C ++?

  3. 我需要使用上面的头文件制作JNI。我需要做什么?我可以通过g ++编译器吗?还是gcc编译器?没有Visual Studio?

2 个答案:

答案 0 :(得分:2)

  1. windows.hunsigned char int #include分别为<windows.h>#define WINDOWS_LEAN_AND_MEAN typedef。可以__stdcall Yii::$app->user->somethingidentity之后{@ 1}}或user
  2. \Yii::$app->user->username 是用于WinAPI函数的标准调用约定。
  3. 查看关于Stackoverflow的其他答案。无需复制其他地方详述的内容。

答案 1 :(得分:1)

我有非常相似的错误消息(但在Linux上)。我决定按照google c++ style guide中的建议来解决它 - 更喜欢{strong> int8_t,uint8_t,int16_t,int64_t等之类的类型,这些类型在<cstdint>中定义。因此,对于BYTE,它是unsigned char的简称,我使用了uint8_t。此解决方案也适用于Linux和Windows

相关问题