adb工具编译错误解决。
来源:互联网 发布:战舰世界猎户座数据 编辑:程序博客网 时间:2024/06/05 14:55
一。编译AdbWinApi:
(a) error C2664: 'CreateFileA' : cannot convert parameter 1 from 'const unsigned short *' to 'const char *'
解决办法:将项目的字符集设置成unicode:
-------------------------------------------------------------------------------------------------------------------------------------------------------
.
(b).>d:\work\project\adb_dev\api\adb_api_instance.h(103): error C2146: 语法错误: 缺少“;”(在标识符“instance_handle_”的前面)
1>d:\work\project\adb_dev\api\adb_api_instance.h(103): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>d:\work\project\adb_dev\api\adb_api_instance.h(110): error C2065: “ADBAPIINSTANCEHANDLE”: 未声明的标识符
1>d:\work\project\adb_dev\api\adb_api_instance.h(110): error C2923: “std::map”: 对于参数“_Kty”,“ADBAPIINSTANCEHANDLE”不是有效的 模板 类型变量
1>d:\work\project\adb_dev\api\adb_api_instance.cpp(39): error C2065: “instance_handle_”: 未声明的标识符
1>d:\work\project\adb_dev\api\adb_api_instance.cpp(40): error C2061: 语法错误: 标识符“ADBAPIINSTANCEHANDLE”
解决办法:在文件中添加typedef void* ADBAPIINSTANCEHANDLE;
----------------------------------------------------------------------------------------------------------------------------------------------------------------
adb_helper_routines.obj : error LNK2019: 无法解析的外部符号 __imp__SetupDiDestroyDeviceInfoList@4,该符号在函数 "bool __cdecl EnumerateDeviceInterfaces(struct _GUID,unsigned long,bool,bool,class std::vector<class AdbInstanceEnumEntry,class std::allocator<class AdbInstanceEnumEntry> > *)" (?EnumerateDeviceInterfaces@@YA_NU_GUID@@K_N1PAV?$vector@VAdbInstanceEnumEntry@@V?$allocator@VAdbInstanceEnumEntry@@@std@@@std@@@Z) 中被引用
1>adb_helper_routines.obj : error LNK2019: 无法解析的外部符号 __imp__SetupDiEnumDeviceInterfaces@20,该符号在函数 "bool __cdecl EnumerateDeviceInterfaces(void *,struct _GUID,bool,bool,class std::vector<class AdbInstanceEnumEntry,class std::allocator<class AdbInstanceEnumEntry> > *)" (?EnumerateDeviceInterfaces@@YA_NPAXU_GUID@@_N2PAV?$vector@VAdbInstanceEnumEntry@@V?$allocator@VAdbInstanceEnumEntry@@@std@@@std@@@Z) 中被引用
1>adb_helper_routines.obj : error LNK2019: 无法解析的外部符号 __imp__SetupDiGetDeviceInterfaceDetailW@24,该符号在函数 "bool __cdecl GetUsbDeviceDetails(void *,struct _SP_DEVICE_INTERFACE_DATA *,struct _SP_DEVICE_INTERFACE_DETAIL_DATA_W * *)" (?GetUsbDeviceDetails@@YA_NPAXPAU_SP_DEVICE_INTERFACE_DATA@@PAPAU_SP_DEVICE_INTERFACE_DETAIL_DATA_W@@@Z) 中被引用
1>adb_helper_routines.obj : error LNK2019: 无法解析的外部符号 __imp__SetupDiGetClassDevsW@16,该符号在函数 "bool __cdecl EnumerateDeviceInterfaces(struct _GUID,unsigned long,bool,bool,class std::vector<class AdbInstanceEnumEntry,class std::allocator<class AdbInstanceEnumEntry> > *)" (?EnumerateDeviceInterfaces@@YA_NU_GUID@@K_N1PAV?$vector@VAdbInstanceEnumEntry@@V?$allocator@VAdbInstanceEnumEntry@@@std@@@std@@
解决办法:在依赖项中添加setupapi.lib
二.AdbWinUsbApi编译出错:
(a)
1>d:\work\project\adb_dev\winusb\adb_winusb_interface.h(170): error C2146: 语法错误: 缺少“;”(在标识符“winusb_handle”的前面)
1>d:\work\project\adb_dev\winusb\adb_winusb_interface.h(170): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
解决办法:
stdafx.h的修改:
将win的版本号改成0x602
#ifndef _WIN32_WINNT // Allow use of features specific to Windows NT 4 or later.
//#define _WIN32_WINNT 0x0500 // Change this to the appropriate value to target Windows 2000 or later.
#define _WIN32_WINNT 0x0602
#endif
#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later.
//#define _WIN32_WINDOWS 0x0500 // Change this to the appropriate value to target Windows Me or later.
#define _WIN32_WINDOWS 0x0602
#endif
- adb工具编译错误解决。
- android下编译adb工具
- 解决adb install 错误INSTALL_FAILED_UPDATE_INCOMPATIBLE
- 解决Pingexample编译错误
- MTK编译错误解决?
- 编译内核错误解决
- android 编译错误解决
- ecos编译错误解决
- 解决busybox编译错误
- VC6编译错误解决
- busybox编译错误解决
- 解决编译错误
- opengl编译错误解决
- gcc编译错误解决
- VS2010编译错误解决
- 编译Sqoop2错误解决
- C++编译错误解决
- 编译常见错误解决
- epoll的原理和应用- I/O多路复用
- Hadoop HA Namenode remote access
- 根据PID获取进程名 或者 根据进程名获取PID
- fatal error LNK1120: 1 unresolved externals
- 转换符说明
- adb工具编译错误解决。
- C++关联容器
- 在IE8,FF中<select>控件文字垂直居中的处理方法
- 发现个Mybatis的bug: XML fragments parsed from previous mappers does not contain value for
- JQuery对iframe页面的操作
- 在驱动中使用链表
- Dlink跨数据库查询
- Android各种蓝牙设备的UUID
- 2014年1月20日 民营银行来了