Link DDK to Driver RRS feed

  • Question

  • Hello everyone. 

    I'm new to driver development, so I'm going to beg your patience here for a moment. 
    I'm writing a virtual display driver using VS2012 Professional Edition and WinDDK 8. 

    I've got the basic skeleton of the driver up, but for some reason I cannot get it to link against displib.lib. I've gather that DxgkInitialize is defined in the library, but the VS compiler continues to think of it as an unresolved external. I'm not sure how to resolve this. Right now I'm linking to $(DDK_LIB_PATH)\displib.lib. 

    If there is another toolchain I should be using to build this I cannot located it. I've read some other posts and ddkbuild.bat doesn't exist on my computer (and since they mention VC++6, I imagine they are woefully out of date!). 

    I'll supply more information if it's relevant, but am I doing anything obviously wrong that I simply can't see?

    Monday, July 22, 2013 8:18 PM


  • Argh. Another C++ confusion.... 

    Try to add extern "C" { }  around the WDK #include 's.

    -- pa

    Monday, July 22, 2013 11:00 PM

All replies

  • Post the exact linker error. The toolchain you described is correct.

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Monday, July 22, 2013 9:15 PM
  • Here is the output of the build log VS produces: 

    Error	1	error LNK2019: unresolved external symbol "long __stdcall DxgkInitialize(struct _DRIVER_OBJECT *,struct _UNICODE_STRING *,struct _DRIVER_INITIALIZATION_DATA *)" (?DxgkInitialize@@YGJPAU_DRIVER_OBJECT@@PAU_UNICODE_STRING@@PAU_DRIVER_INITIALIZATION_DATA@@@Z) referenced in function _DriverEntry@8	PATH_TO_DRIVER_PROJECT\Driver.obj

    Not sure that that's helpful. It looks like it simply can't find the definition of DxgkInitialize, but I have run into some errors (I'm using C++, not C, and have had to port code accordingly), am I missing an extern statement?

    Monday, July 22, 2013 10:12 PM
  • Turns out, I had done this for almost all include headers from the ddk... except dispmprt, wdm, and wdf. 

    Sorry for the waste of time, and thanks for the answers!

    Tuesday, July 23, 2013 10:01 PM