我想做个bluetooth 程序,但安装了Windows7 SDK ,运行里面的例子,但发现SDK中变量函数未定义: 
请问如何解决此问题. 
我已经运行了Windows SDK configuration tool ,并且查看了tools -> optional -> projects and solution -> VC Directories 中包含有SDK 的路径! bluetooth.cpp(29) : error C2065: 'BTH_MAX_NAME_SIZE' : undeclared identifier 
bluetooth.cpp(35) : error C2061: syntax error : identifier 'PSOCKADDR_BTH' 
\bluetooth.cpp(36) : error C2065: 'SOCKADDR_BTH' : undeclared identifier 
\bluetooth.cpp(36) : error C2146: syntax error : missing ')' before identifier 'ululRemoteBthAddr' 
\bluetooth.cpp(36) : error C2059: syntax error : ')' 

解决方案 »

  1.   

    SDK里面带一个nmake的makefile,用那个编译,再不行换VC++2008SP1,VS2005早过时了。
      

  2.   

    I'm sorry you' ve hit the problem described in the Windows SDK for Windows 7 Release Notes (see below).  We’ve tried to make the Windows SDKs backward compatible whenever possible, but sometimes issues are found with older products that can’t be resolved.  In this case, the root cause is an issue in the C/C++ compiler for Visual Studio 2005 SP1 which conflicts with Visual Studio 2008 and later.  For more info on this please see the Windows SDK Blog article, Windows 7 SDK with Visual C++ 2005: Failure to compile in Debug mode. If you find yourself unable to link using /DEBUG in the Windows SDK command line build environment or Visual Studio 2005 SP1 and receive the below error, you may be interested in reading the Microsoft Knowledge Base article KB949009, which links to the patch to fix the issue.  I just tested the patch and it downloaded without a problem.Just Use  VC2008