简体   繁体   English

WinUsb with C++ Builder 10.3 社区版

[英]WinUsb with C++ Builder 10.3 community edition

Has anyone successfully used winusb.h with Embarcadero's C++Builder 10.3 Community Edition?有没有人成功地将winusb.h与 Embarcadero 的 C++Builder 10.3 社区版一起使用?

I recently downloaded 10.3 this with a view to updating a PC desktop/laptop application I wrote some years ago for Windows XP (using Borland C++Builder 6), which uses WinUSB functions to drive (one at a time) three machines.我最近下载了 10.3,以更新我几年前为 Windows XP(使用 Borland C++Builder 6)编写的 PC 桌面/笔记本电脑应用程序,它使用 WinUSB 功能来驱动(一次一台)三台机器。

Attempting to run the executable on Windows 10 results in protection faults on USB device access - it works fine on XP, and Windows 7.尝试在 Windows 10 上运行可执行文件会导致 USB 设备访问出现保护错误 - 它在 XP 和 Windows 7 上运行良好。

The USB device has been updated for auto recognition by Windows 10 (Thanks, P. Batard), and using Microsoft's example at How to Access a USB Device by Using WinUSB Functions , I'm confident that there's no problem with the device - it loads, and I can interrogate the descriptors, using WinUSB function calls, coded from within a Visual Studio environment on a Windows 10 computer. USB 设备已被 Windows 10 更新为自动识别(谢谢,P. Batard),并使用 Microsoft 在如何访问 USB 设备的示例,我确信该设备没有问题, ,我可以使用 WinUSB function 调用来查询描述符,这些调用是在 Windows 10 计算机上的 Visual Studio 环境中编码的。

Back to Embarcadero's C++Builder 10.3 Community Edition - I can write an application which will respond to button presses (compile, link and execute ok), but when I include any of the functions from winusb.h , I'm getting errors:回到 Embarcadero 的 C++Builder 10.3 社区版 - 我可以编写一个响应按钮按下的应用程序(编译、链接和执行 ok),但是当我包含来自winusb.h的任何函数时,我得到了错误:

[ilink32 Error] Error: Unresolved external 'WinUsb_(func)' referenced from (path edited) UNITx.OBJ [ilink32 错误] 错误:未解析的外部“WinUsb_(func)”引用自(路径已编辑)UNITx.OBJ

Usually, I'd take this to mean I've failed to include a required header, or the path to that header (or lib) can't be resolved, but I'm pretty certain this isn't the case - the header is definitely 'included', and I've edited the IDE path to explicitly include the winusb.h and winusb.lib file directories - they are 'buried' quite deeply, but are definitely present.通常,我认为这意味着我没有包含所需的 header,或者无法解决 header(或 lib)的路径,但我很确定这不是这种情况 - Z099E43995346F3394C绝对是“包含”的,我已经编辑了 IDE 路径以明确包含winusb.hwinusb.lib文件目录 - 它们被“隐藏”得很深,但肯定存在。 I've even tried copying both files to the project directory, but to no avail.我什至尝试将这两个文件复制到项目目录,但无济于事。

I've searched the Embarcadero community site, but can find no reference to 'winusb'.我搜索了 Embarcadero 社区网站,但找不到对“winusb”的引用。

I appreciate that this is a far more complex environment than that of C++Builder 6, and that I could very well be missing something, but I can't shake the feeling that something in the IDE isn't working as it should - other headers link ok.我很欣赏这是一个比 C++Builder 6 复杂得多的环境,而且我很可能会遗漏一些东西,但我无法摆脱 IDE 中的某些东西无法正常工作的感觉 -其他标题链接确定。

Ideas, anyone please?想法,有人请吗?

It is not enough to simply point the IDE to the folder containing Winusb.lib , you have to actually add that .lib file to your C++ project, or reference it explicitly in your C++ code using a #pragma comment(lib, "Winusb.lib") statement, otherwise the .lib file won't be passed to the linker to resolve your calls to the WinUSB functions. It is not enough to simply point the IDE to the folder containing Winusb.lib , you have to actually add that .lib file to your C++ project, or reference it explicitly in your C++ code using a #pragma comment(lib, "Winusb.lib")语句,否则.lib文件将不会传递给 linker 以解析您对 WinUSB 函数的调用。

This extra step was also required of most .lib files in C++Builder 6 too, BTW.顺便说一句,C++Builder 6 中的大多数.lib文件也需要这个额外的步骤。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 C++ Builder 10.4 社区版 => scoped_lock 丢失(至少似乎是一个路径混乱) - C++ Builder 10.4 community edition => scoped_lock are missing (at least seems to be a path mess) Intellij-Idea社区版的C / C ++插件 - C/C++ Plugin for Intellij-Idea Community edition 使用Visual Studio 2015社区版在C ++中#include excel错误 - #include excel error in C++ with Visual Studio 2015, Community edition 有没有办法在 C++ Visual Studio 2019(社区版)中允许这样做? - Is there a way to allow this in C++ Visual Studio 2019 (Community Edition)? C++ Builder 10.3 无法从 const char[18] 分配给 const wchar_t* - C++ Builder 10.3 can not assign to const wchar_t* from const char[18] 在C ++ Builder 10.3中使用ENet会导致“在命名空间std中没有名为'strftime'的成员”的问题 - using ENet in C++ builder 10.3 causes “no member named 'strftime' in namespace std” issue VS 2015 Community Edition中的项目属性UI中的C / C ++预处理程序设置在哪里? - Where are C/C++ Preprocessor settings in project properties UI in VS 2015 Community Edition? 如何从Visual Studio 2017社区版C ++项目中导出DLL? - How to export a DLL from Visual Studio 2017 Community Edition C++ Project? 是否可以使用Visual Studio 2013 Community Edition创建静态库C ++? - Is it possible to create a static library C++ with Visual Studio 2013 Community Edition? 如何在Visual Studio Community Edition中将pthread库添加到C ++项目? - How to add pthread library to C++ project in Visual Studio Community Edition?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM