Xman
驱动大牛
驱动大牛
  • 注册日期2001-08-24
  • 最后登录2011-10-07
  • 粉丝0
  • 关注0
  • 积分343分
  • 威望127点
  • 贡献值0点
  • 好评度34点
  • 原创分0分
  • 专家分0分
阅读:1570回复:9

这两函数在什么库里面????

楼主#
更多 发布于:2004-09-16 19:24

Linking...
USBPortDlg.obj : error LNK2001: unresolved external symbol "unsigned char __stdcall HidD_GetAttributes(void *,struct _HIDD_ATTRIBUTES *)" (?HidD_GetAttributes@@YGEPAXPAU_HIDD_ATTRIBUTES@@@Z)
USBPortDlg.obj : error LNK2001: unresolved external symbol "void __stdcall HidD_GetHidGuid(struct _GUID *)" (?HidD_GetHidGuid@@YGXPAU_GUID@@@Z)
 

HidD_GetAttributes
HidD_GetHidGuid

最新喜欢:

znsoftznsoft
[img]http://www.driverdevelop.com/forum/upload/Xman/2004-04-05_2004324183110706.jpg[/img]
wowocock
VIP专家组
VIP专家组
  • 注册日期2002-04-08
  • 最后登录2016-01-09
  • 粉丝16
  • 关注2
  • 积分601分
  • 威望1651点
  • 贡献值1点
  • 好评度1227点
  • 原创分1分
  • 专家分0分
沙发#
发布于:2004-09-16 22:49
hidsdi.h
在HID.LIB中,别忘了在函数前加EXTERN "C"
生成的函数名应该诸如_HidD_GetAttributes@8
花开了,然后又会凋零,星星是璀璨的,可那光芒也会消失。在这样 一瞬间,人降生了,笑者,哭着,战斗,伤害,喜悦,悲伤憎恶,爱。一切都只是刹那间的邂逅,而最后都要归入死亡的永眠
Xman
驱动大牛
驱动大牛
  • 注册日期2001-08-24
  • 最后登录2011-10-07
  • 粉丝0
  • 关注0
  • 积分343分
  • 威望127点
  • 贡献值0点
  • 好评度34点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2004-09-17 08:40
没错,问题解决了,可是又出现了



Generating Code...
Linking...
USBPort.obj : error LNK2001: unresolved external symbol __chkesp
USBPortDlg.obj : error LNK2001: unresolved external symbol __chkesp
Debug/USBPort.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

USBPort.exe - 3 error(s), 0 warning(s)
 :(
[img]http://www.driverdevelop.com/forum/upload/Xman/2004-04-05_2004324183110706.jpg[/img]
arthurtu
驱动巨牛
驱动巨牛
  • 注册日期2001-11-08
  • 最后登录2020-12-19
  • 粉丝0
  • 关注0
  • 积分26分
  • 威望161点
  • 贡献值0点
  • 好评度35点
  • 原创分0分
  • 专家分0分
  • 社区居民
地板#
发布于:2004-09-17 09:05
去掉/GZ选项
Xman
驱动大牛
驱动大牛
  • 注册日期2001-08-24
  • 最后登录2011-10-07
  • 粉丝0
  • 关注0
  • 积分343分
  • 威望127点
  • 贡献值0点
  • 好评度34点
  • 原创分0分
  • 专家分0分
地下室#
发布于:2004-09-17 11:10
arthurtu:

能解释一下/GZ的含义吗?

顺便问一下,这些设置参数哪儿有资料查! :)
[img]http://www.driverdevelop.com/forum/upload/Xman/2004-04-05_2004324183110706.jpg[/img]
arthurtu
驱动巨牛
驱动巨牛
  • 注册日期2001-11-08
  • 最后登录2020-12-19
  • 粉丝0
  • 关注0
  • 积分26分
  • 威望161点
  • 贡献值0点
  • 好评度35点
  • 原创分0分
  • 专家分0分
  • 社区居民
5楼#
发布于:2004-09-17 11:44
MSDN啦
wowocock
VIP专家组
VIP专家组
  • 注册日期2002-04-08
  • 最后登录2016-01-09
  • 粉丝16
  • 关注2
  • 积分601分
  • 威望1651点
  • 贡献值1点
  • 好评度1227点
  • 原创分1分
  • 专家分0分
6楼#
发布于:2004-09-17 13:17
MSDN啦
 

把完整的解释贴出来吧......
花开了,然后又会凋零,星星是璀璨的,可那光芒也会消失。在这样 一瞬间,人降生了,笑者,哭着,战斗,伤害,喜悦,悲伤憎恶,爱。一切都只是刹那间的邂逅,而最后都要归入死亡的永眠
Xman
驱动大牛
驱动大牛
  • 注册日期2001-08-24
  • 最后登录2011-10-07
  • 粉丝0
  • 关注0
  • 积分343分
  • 威望127点
  • 贡献值0点
  • 好评度34点
  • 原创分0分
  • 专家分0分
7楼#
发布于:2004-09-17 13:50
Visual C++ Compiler Options  

/Gd, /Gr, /Gz (Calling Convention)See Also
Compiler Options | Setting Compiler Options
/Gd
/Gr
/Gz
These options determine:

The order in which function arguments are pushed onto the stack.
Whether the caller function or called function removes the arguments from the stack at the end of the call.
The name-decorating convention that the compiler uses to identify individual functions.
/Gd, the default setting, specifies the C calling convention for all functions except C++ member functions and functions marked __stdcall or __fastcall.

/Gr specifies the __fastcall calling convention for all functions except C++ member functions and functions marked __cdecl or __stdcall. All __fastcall functions must have prototypes.

/Gz specifies the __stdcall calling convention for all prototyped C functions except for functions that take a variable number of arguments and functions marked __cdecl or __fastcall. All __stdcall functions must have prototypes.

Note   x86 Specific ―>By default, C++ member functions use a calling convention in cases where the member function's this pointer is passed in the ECX register. All other arguments are pushed onto the stack from right to left, and the called routine pops the member function's arguments from the stack. END x86 Specific A member function that is explicitly marked as __cdecl, __fastcall, or __stdcall uses the specified calling convention. A member function that takes a variable number of arguments always uses the __cdecl calling convention.
__cdecl Specifics
For C, the __cdecl naming convention uses the function name preceded by an underscore ( _ ); no case translation is performed. Unless declared as extern "C", C++ functions use a different name-decorating scheme. For more information, see Decorated Names.

__fastcall Specifics
Some of a __fastcall function's arguments are passed in registers x86 Specific ―> ECX and EDX END x86 Specific, and the rest are pushed onto the stack from right to left. The called routine pops these arguments from the stack before it returns. Typically, /Gr decreases execution time.

Note   Be careful when using the __fastcall calling convention for any function written in inline assembly language. Your use of registers could conflict with the compiler's use.
For C, the __fastcall naming convention uses the function name preceded by an at sign (@) followed by the size of the function's arguments in bytes. No case translation is done. The compiler uses the following template for the naming convention:

@function_name@number
Note   Microsoft does not guarantee the same implementation of the __fastcall calling convention between compiler releases. For example, the implementation differs between the 16-bit and 32-bit compilers.
When using the __fastcall naming convention, use the standard include files. Otherwise you will get unresolved external references.

__stdcall Specifics
A __stdcall function's arguments are pushed onto the stack from right to left, and the called function pops these arguments from the stack before it returns.

For C, the __stdcall naming convention uses the function name preceded by an underscore ( _ ) and followed by an at sign (@) and the size of the function's arguments in bytes. No case translation is performed. The compiler uses the following template for the naming convention:

_functionname@number
x86 Specific ―>

This option has no effect on the name decoration of C++ methods and functions. Unless declared as extern "C", C++ methods and functions use a different name-decorating scheme. For more information, see Decorated Names.

END x86 Specific

To set this compiler option in the Visual Studio development environment

Open the project's Property Pages dialog box. For details, see Setting Visual C++ Project Properties.
Click the C/C++ folder.
Click the Advanced property page.
Modify the Calling Convention property.
To set this compiler option programmatically

See CallingConvention Property.

See Also
Compiler Options | Setting Compiler Options

 :D :D :D
[img]http://www.driverdevelop.com/forum/upload/Xman/2004-04-05_2004324183110706.jpg[/img]
arthurtu
驱动巨牛
驱动巨牛
  • 注册日期2001-11-08
  • 最后登录2020-12-19
  • 粉丝0
  • 关注0
  • 积分26分
  • 威望161点
  • 贡献值0点
  • 好评度35点
  • 原创分0分
  • 专家分0分
  • 社区居民
8楼#
发布于:2004-09-17 15:45
ft,找错了,那是/Gz,不是/GZ,大写的。
我把2001 MSDN卸了,在VC6,Enable Stack Frame Run-Time Error Checking
.net和/RTC1选项一样,Run-Time Error Checks
zblaoshu
驱动牛犊
驱动牛犊
  • 注册日期2004-08-13
  • 最后登录2005-03-29
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
9楼#
发布于:2004-10-15 11:18
extern "c"
{
#include "hidsdi.h"
#include "setupapi.h"
}
游客

返回顶部