none
Strange errors while building UMDF driver in Visual Studio RRS feed

  • Question

  • When I build my UMDF driver (Vitual Smart Card Driver) I get errors of WDF's winioct.h file:

    1>------ Rebuild All started: Project: BixVReader, Configuration: Win7 Debug x64 ------
    1>  Stamping x64\Win7Debug\BixVReader.inf [Version] section with DriverVer=01/10/2013,18.16.3.823
    1>  Device.cpp
    1>C:\Program Files (x86)\Windows Kits\8.0\Include\UM\winioctl.h(39): error C2374: 'GUID_DEVINTERFACE_DISK' : redefinition; multiple initialization
    1>          C:\Program Files (x86)\Windows Kits\8.0\Include\UM\winioctl.h(39) : see declaration of 'GUID_DEVINTERFACE_DISK'
    1>C:\Program Files (x86)\Windows Kits\8.0\Include\UM\winioctl.h(40): error C2374: 'GUID_DEVINTERFACE_CDROM' : redefinition; multiple initialization
    1>          C:\Program Files (x86)\Windows Kits\8.0\Include\UM\winioctl.h(40) : see declaration of 'GUID_DEVINTERFACE_CDROM'
    1>C:\Program Files (x86)\Windows Kits\8.0\Include\UM\winioctl.h(41): error C2374: 'GUID_DEVINTERFACE_PARTITION' : redefinition; multiple initialization
    1>          C:\Program Files (x86)\Windows Kits\8.0\Include\UM\winioctl.h(41) : see declaration of 'GUID_DEVINTERFACE_PARTITION'
    1>C:\Program Files (x86)\Windows Kits\8.0\Include\UM\winioctl.h(42): error C2374: 'GUID_DEVINTERFACE_TAPE' : redefinition; multiple initialization
    1>          C:\Program Files (x86)\Windows Kits\8.0\Include\UM\winioctl.h(42) : see declaration of 'GUID_DEVINTERFACE_TAPE'
    1>C:\Program Files (x86)\Windows Kits\8.0\Include\UM\winioctl.h(43): error C2374: 'GUID_DEVINTERFACE_WRITEONCEDISK' : redefinition; multiple initialization
    1>          C:\Program Files (x86)\Windows Kits\8.0\Include\UM\winioctl.h(43) : see declaration of 'GUID_DEVINTERFACE_WRITEONCEDISK'
    1>C:\Program Files (x86)\Windows Kits\8.0\Include\UM\winioctl.h(44): error C2374: 'GUID_DEVINTERFACE_VOLUME' : redefinition; multiple initialization
    1>          C:\Program Files (x86)\Windows Kits\8.0\Include\UM\winioctl.h(44) : see declaration of 'GUID_DEVINTERFACE_VOLUME'
    1>C:\Program Files (x86)\Windows Kits\8.0\Include\UM\winioctl.h(45): error C2374: 'GUID_DEVINTERFACE_MEDIUMCHANGER' : redefinition; multiple initialization
    1>          C:\Program Files (x86)\Windows Kits\8.0\Include\UM\winioctl.h(45) : see declaration of 'GUID_DEVINTERFACE_MEDIUMCHANGER'
    1>C:\Program Files (x86)\Windows Kits\8.0\Include\UM\winioctl.h(46): error C2374: 'GUID_DEVINTERFACE_FLOPPY' : redefinition; multiple initialization
    1>          C:\Program Files (x86)\Windows Kits\8.0\Include\UM\winioctl.h(46) : see declaration of 'GUID_DEVINTERFACE_FLOPPY'
    1>C:\Program Files (x86)\Windows Kits\8.0\Include\UM\winioctl.h(47): error C2374: 'GUID_DEVINTERFACE_CDCHANGER' : redefinition; multiple initialization
    1>          C:\Program Files (x86)\Windows Kits\8.0\Include\UM\winioctl.h(47) : see declaration of 'GUID_DEVINTERFACE_CDCHANGER'
    1>C:\Program Files (x86)\Windows Kits\8.0\Include\UM\winioctl.h(48): error C2374: 'GUID_DEVINTERFACE_STORAGEPORT' : redefinition; multiple initialization
    1>          C:\Program Files (x86)\Windows Kits\8.0\Include\UM\winioctl.h(48) : see declaration of 'GUID_DEVINTERFACE_STORAGEPORT'
    1>C:\Program Files (x86)\Windows Kits\8.0\Include\UM\winioctl.h(49): error C2374: 'GUID_DEVINTERFACE_VMLUN' : redefinition; multiple initialization
    1>          C:\Program Files (x86)\Windows Kits\8.0\Include\UM\winioctl.h(49) : see declaration of 'GUID_DEVINTERFACE_VMLUN'
    1>C:\Program Files (x86)\Windows Kits\8.0\Include\UM\winioctl.h(50): error C2374: 'GUID_DEVINTERFACE_SES' : redefinition; multiple initialization
    1>          C:\Program Files (x86)\Windows Kits\8.0\Include\UM\winioctl.h(50) : see declaration of 'GUID_DEVINTERFACE_SES'
    1>C:\Program Files (x86)\Windows Kits\8.0\Include\UM\winioctl.h(59): error C2374: 'GUID_DEVINTERFACE_HIDDEN_VOLUME' : redefinition; multiple initialization
    1>          C:\Program Files (x86)\Windows Kits\8.0\Include\UM\winioctl.h(59) : see declaration of 'GUID_DEVINTERFACE_HIDDEN_VOLUME'
    1>C:\Program Files (x86)\Windows Kits\8.0\Include\UM\winioctl.h(61): error C2374: 'GUID_DEVINTERFACE_COMPORT' : redefinition; multiple initialization
    1>          C:\Program Files (x86)\Windows Kits\8.0\Include\UM\winioctl.h(61) : see declaration of 'GUID_DEVINTERFACE_COMPORT'
    1>C:\Program Files (x86)\Windows Kits\8.0\Include\UM\winioctl.h(62): error C2374: 'GUID_DEVINTERFACE_SERENUM_BUS_ENUMERATOR' : redefinition; multiple initialization
    1>          C:\Program Files (x86)\Windows Kits\8.0\Include\UM\winioctl.h(62) : see declaration of 'GUID_DEVINTERFACE_SERENUM_BUS_ENUMERATOR'
    1>  Dllsup.cpp
    1>  Driver.cpp
    1>  IoQueue.cpp
    1>  Memory.cpp
    1>  Generating Code...
    2>------ Rebuild All started: Project: BixVReader Package, Configuration: Win7 Debug x64 ------
    2>C:\Program Files (x86)\Windows Kits\8.0\build\WindowsDriver8.0.common.targets(1347,5): error MSB3030: Could not copy the file "D:\projects\Drivers\new\BixVReader\x64\Win7Debug\BixVReader.dll" because it was not found.
    ========== Rebuild All: 0 succeeded, 2 failed, 0 skipped ==========
    So I haven't an idea what is a reason and how to fix it. Please help!

    Thursday, January 10, 2013 2:45 PM

Answers

  • Are you including initguid.h in more than one CPP file?  You are redefining the guids in multiple files and that typically is because you included initguid.h in more than one CPP file or in an include file that then got included in more than one CPP file.


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    Thursday, January 10, 2013 2:55 PM

All replies

  • Are you including initguid.h in more than one CPP file?  You are redefining the guids in multiple files and that typically is because you included initguid.h in more than one CPP file or in an include file that then got included in more than one CPP file.


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    Thursday, January 10, 2013 2:55 PM
  • Hmm.

    These errors dropped when I swaped #include "winioctl.h" and #include <initguid.h>:

    //
    // Windows IOCTL definitions.
    //
    #include "winioctl.h"
    
    //
    // GUID include
    //
    #include <initguid.h>
    
    //
    // Device Interface GUID
    // 0x50DD5230, 0xBA8A, 0x11D1, 0xBF,0x5D,0x00,0x00,0xF8,0x05,0xF5,0x30
    //
    DEFINE_GUID(GUID_DEVINTERFACE_BixVReader,
        0x50DD5230, 0xBA8A, 0x11D1, 0xBF,0x5D,0x00,0x00,0xF8,0x05,0xF5,0x30);

    I'm not an exper in C++ and it seems strange to me.

    Thank you for sending to the solution of the problem. Any comments on this issue are welcome.


    • Edited by Zharro Thursday, January 10, 2013 3:20 PM incompleteness
    Thursday, January 10, 2013 3:09 PM