Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 6 of 6

Thread: Do I need Windows Driver Kit (WDK) to build "rawhid" example? (missing ddk/hidsdi.h)

  1. #1
    Junior Member
    Join Date
    Apr 2013
    Posts
    2

    Question Do I need Windows Driver Kit (WDK) to build "rawhid" example? (missing ddk/hidsdi.h)

    I would like to use a windows program to send some bytes to my Teensy3 (love the product, btw!).

    I found the rawhid project (http://www.pjrc.com/teensy/rawhid.html), and thought I could use this as a template from which to base my small program.

    However when I included all the files in the rawhid test project into VC++ and tried to compile I got the error "cannot open 'ddk/hidsdi.h'".

    If I search for this it seems it is a part of the Windows Driver Kit. Do I need to download and install all 700MB of the WDK to be able to compile this tiny program, or am I going about this the wrong way? I didn't see any mention about this on the rawhid page, and it's not clear to me if there's some way to use this without writing my own driver.

    Thanks for any help or explanation!

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,563
    I have not personally used Visual Studio, this this answer is based only on what I've heard from others.

    Yes, you do need the huge driver kit. Why Microsoft can't provide headers for all WIN32 functions is a mystery to me, but that's the way it is with them. I'm sure it makes perfect sense to someone at Microsoft?

    I personally use MinGW. I run it on Linux as a cross compiler, and then copy the .exe to a Windows machine for testing. But of course MinGW can run natively on Windows. It includes headers for all WIN32 functions (unlike Microsoft's tools).

  3. #3
    Junior Member
    Join Date
    Apr 2013
    Posts
    2
    Thanks for the feedback. In case anyone else finds himself in my situation, I went ahead and used HIDAPI (http://www.signal11.us/oss/hidapi/) to send arbitrary HID data to my teensy, so I didn't have to mess with the WDK. I'm not sure how they get away without needing the ddk headers, but by just downloading their api and including their headers I was able to easily write a very simple C program on windows to send arbitrary 64B data packets to my Teensy3.

    Would have used rawhid but WDK looks ridiculously obnoxious to set up, have to download a 700MB ISO, burn it to a DVD, and then boot from that dvd to install it, which sounds like way too much trouble.

    Thanks again!

  4. #4
    Junior Member
    Join Date
    Sep 2013
    Posts
    4
    As a new user, I'm hitting a wall here.

    I ran into the same issue as the OP, trying to build, then modify for my use, the simple Windows HID interface.
    I have installed MinGW, with gcc and g++, and got that working for basic console programs use.
    Using the pre-compiled rawhid_test.exe and hid_listen.exe, my Teensy (2.0) code works as expected, so the MCU toolchain is OK, and the HID interface is working.

    I've downloaded HID API, as karwosts suggested, and tried to set up the directories as instructed, but get immediate build errors.
    At this point, I'm stuck, unable to build rawhid_test.exe and don't know how to get there.

    Any suggestions from more experienced folks would be greatly appreciated!

    Dave
    Last edited by dbell; 09-19-2013 at 08:16 PM. Reason: typo

  5. #5

  6. #6
    Junior Member
    Join Date
    Sep 2013
    Posts
    4
    Thank you, tni! I'll give that a try.

    Dave

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •