积极答复者
蓝牙API的问题!

问题
-
WIN7..32bit
VS2008SP1
在使用蓝牙API的时候 出现这个错误
1>c:\program files\microsoft sdks\windows\v6.0a\include\bluetoothapis.h(1575) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files\microsoft sdks\windows\v6.0a\include\bluetoothapis.h(1575) : error C2143: 语法错误 : 缺少“,”(在“*”的前面)‘DWORD
WINAPI
BluetoothSetLocalServiceInfo(
__in_opt HANDLE hRadioIn
, __in const GUID * pClassGuid
, ULONG ulInstance
, const BLUETOOTH_LOCAL_SERVICE_INFO * pServiceInfoIn //指向这里
);这个是什么意思呢?
…|▌'寔堅蔃の/「≯還寔╪.逞蔃﹖
答案
-
包含了windows.h么?Windows版本定义了么
The following is signature, not part of post
Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
Visual C++ MVP- 已标记为答案 lucy-liuModerator 2011年3月4日 9:38
-
Hi dowflyon,
>> error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1. (此情况经常出现在大型工程项目中)如果存在两个类的头文件a.h和b.h,在a.h中有这样的语句:#include "b.h",在b.h文件中有这样的语句:#include "a.h" 且在一个类中有另一个类的对象时 那么就会出现这样的错误。
2. 没有包含要定义的类的头文件。
3.项目中少加了宏定义,导致头文件重复定义或相应宏无法识别。
4.当有多个头文件时,顺序写反也可能导致相关的错误,其根本是头文件中的预编译语句被隐去了。
e.g
#include <stdio.h>
#include <Windows.h>
#include <WinCrypt.h>
#include <string.h>
如果把第二个和第三个写反,一个宏定义就被#if给注了,就会出现类似错误
>> error C2143: 语法错误 : 缺少“,”(在“*”的前面)‘
绝大多数的情况是因为头文件引用造成的;同样,在同一个文件中,不同类的顺序也会造成这样的错误
具体请看:http://msdn.microsoft.com/en-us/library/0afb82ta(v=VS.90).aspx
如果您的问题解决了,请把有用的回答标记为答案!
谢谢,
Lucy
Lucy Liu [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- 已标记为答案 lucy-liuModerator 2011年3月4日 9:38
全部回复
-
包含了windows.h么?Windows版本定义了么
The following is signature, not part of post
Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
Visual C++ MVP- 已标记为答案 lucy-liuModerator 2011年3月4日 9:38
-
Hi dowflyon,
>> error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1. (此情况经常出现在大型工程项目中)如果存在两个类的头文件a.h和b.h,在a.h中有这样的语句:#include "b.h",在b.h文件中有这样的语句:#include "a.h" 且在一个类中有另一个类的对象时 那么就会出现这样的错误。
2. 没有包含要定义的类的头文件。
3.项目中少加了宏定义,导致头文件重复定义或相应宏无法识别。
4.当有多个头文件时,顺序写反也可能导致相关的错误,其根本是头文件中的预编译语句被隐去了。
e.g
#include <stdio.h>
#include <Windows.h>
#include <WinCrypt.h>
#include <string.h>
如果把第二个和第三个写反,一个宏定义就被#if给注了,就会出现类似错误
>> error C2143: 语法错误 : 缺少“,”(在“*”的前面)‘
绝大多数的情况是因为头文件引用造成的;同样,在同一个文件中,不同类的顺序也会造成这样的错误
具体请看:http://msdn.microsoft.com/en-us/library/0afb82ta(v=VS.90).aspx
如果您的问题解决了,请把有用的回答标记为答案!
谢谢,
Lucy
Lucy Liu [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- 已标记为答案 lucy-liuModerator 2011年3月4日 9:38