如何在c ++中使用HidD_GetHidGuid()? [英] How to use HidD_GetHidGuid() in c++?

查看:3358
本文介绍了如何在c ++中使用HidD_GetHidGuid()?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发布了一个类似的主题/问题,但这次有点不同。

I've posted a similar topic/question, but this time it's a bit different.

我只是试图使用HidD_GetHidGuid该窗口的guid为一些隐藏的设备,但它给我一个错误LNK2019:未解决的外部符号_HidD_GetHidGuid @ 4引用的函数_main

I'm just trying to use the HidD_GetHidGuid() function to get the window's guid for some hid devices, but it's giving me a error LNK2019: unresolved external symbol _HidD_GetHidGuid@4 referenced in function _main

我的代码:

//mainframe.cpp
#include<iostream>
#include<Windows.h>

extern "C"
{
#include<hidsdi.h>
#include<SetupAPI.h>
}

int main()
{
    int iQuit;
    LPGUID guid;
    HidD_GetHidGuid(guid);

    std::cout << "testing program" << std::endl;
    std::cout << guid << std::endl;


    std::cin >> iQuit;

    return 0;
}



在我的VC ++目录中添加了C:\WinDDK\7600.16385 .1 \inc\ddk和C:\WinDDK\7600.16385.1\\\api到包含目录。对于库目录,我添加了C:\WinDDK\7600.16385.1\lib

In my VC++ directories I've added C:\WinDDK\7600.16385.1\inc\ddk and C:\WinDDK\7600.16385.1\inc\api to the "include directories". For "Library directories", I have added C:\WinDDK\7600.16385.1\lib

但它只是给了这个1错误,不知道为什么。 ..请帮助

But it's just giving this 1 error, have no idea why... Please help

感谢

推荐答案

=http://msdn.microsoft.com/en-us/library/windows/hardware/ff538924%28v=vs.85%29.aspx =nofollow>文档,您需要链接 hid.lib

According to the documentation, you need to link against hid.lib

这篇关于如何在c ++中使用HidD_GetHidGuid()?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆