none
compilation error in the driver example RRS feed

  • Question

  • hello.

    I cant compile example project (Windows-driver-samples-master\general\pcidrv\) - something wrong with DBG_INIT - part if it underlined, part not.

    my system: win8.1 + vs2015 + WDK10+ driver examples

    where is the mistake?

    Monday, September 12, 2016 11:06 AM

Answers

  • For me, pcidrv.c from the Windows-driver-samples-master.zip  gives 

    1>------ Build started: Project: PCIDRV, Configuration: Debug Win32 ------
    1>  Building 'PCIDRV' with toolset 'WindowsKernelModeDriver10.0' and the 'Desktop' target platform.
    1>  Stamping .\Debug\\genpci.inf [Version] section with DriverVer=09/13/2016,0.50.15.453
    1>  Microsoft (R) MOF-Compiler, Version 10.0.14393.0
    1>  Copyright (c) Microsoft Corp. 1997-2006. Alle Rechte vorbehalten.
    1>  Die folgende MOF-Datei wird analysiert: ..\pcidrv.mof
    1>  Die MOF-Datei wurde erfolgreich verarbeitet.
    1>  Binäre MOF-Daten werden in .\Debug\\pcidrv.bmf gespeichert.
    1>  Fertig!
    1>  Microsoft (R) WDM Extensions To WMI MOF Checking Utility  Version 1.50.0000
    1>  Copyright (c) Microsoft Corp. 1997-2000. All rights reserved.
    1>
    1>  Binary mof file .\Debug\\pcidrv.bmf expanded to 1224 bytes
    1>  precompsrc.c
    1>  pcidrv.c
    1>..\pcidrv.c(118): error C4013: 'WPP_CALL_PCIDRV_C118' undefined; assuming extern returning int
    1>..\pcidrv.c(118): error C2065: 'DBG_INIT': undeclared identifier
    1>..\pcidrv.c(143): error C4013: 'WPP_CALL_PCIDRV_C143' undefined; assuming extern returning int
    1>..\pcidrv.c(143): error C2065: 'DBG_INIT': undeclared identifier
    ...
    1>..\pcidrv.c(1668): error C4013: 'WPP_CALL_PCIDRV_C1668' undefined; assuming extern returning int
    1>..\pcidrv.c(1668): error C2065: 'DBG_PNP': undeclared identifier
    1>..\pcidrv.c(1683): error C4013: 'WPP_CALL_PCIDRV_C1683' undefined; assuming extern returning int
    1>..\pcidrv.c(1683): error C2065: 'DBG_PNP': undeclared identifier
    1>  wmi.c
    1>  nic_init.c
    1>  eeprom.c
    1>  nic_recv.c
    1>  nic_send.c
    1>  routines.c
    1>  physet.c
    1>  nic_req.c
    1>  nic_pm.c
    1>  isrdpc.c
    1>  Generating Code...
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    After saving pcidrv.c with 'File->Advanced Save Options' (Windows 10 Anniversary german Target OS 10)

    - and enabling Inf2Cat 'Use Local Time' build seems to succeed:

    1>------ Rebuild All started: Project: PCIDRV, Configuration: Debug Win32 ------
    1>  Building 'PCIDRV' with toolset 'WindowsKernelModeDriver10.0' and the 'Desktop' target platform.
    1>  Stamping .\Debug\\genpci.inf [Version] section with DriverVer=09/13/2016,1.7.8.89
    1>  Microsoft (R) MOF-Compiler, Version 10.0.14393.0
    1>  Copyright (c) Microsoft Corp. 1997-2006. Alle Rechte vorbehalten.
    1>  Die folgende MOF-Datei wird analysiert: ..\pcidrv.mof
    1>  Die MOF-Datei wurde erfolgreich verarbeitet.
    1>  Binäre MOF-Daten werden in .\Debug\\pcidrv.bmf gespeichert.
    1>  Fertig!
    1>  Binary mof file .\Debug\\pcidrv.bmf expanded to 1224 bytes
    1>  Microsoft (R) WDM Extensions To WMI MOF Checking Utility  Version 1.50.0000
    1>  Copyright (c) Microsoft Corp. 1997-2000. All rights reserved.
    1>
    1>  precompsrc.c
    1>  pcidrv.c
    1>  wmi.c
    1>  nic_init.c
    1>  eeprom.c
    1>  nic_recv.c
    1>  nic_send.c
    1>  routines.c
    1>  physet.c
    1>  nic_req.c
    1>  nic_pm.c
    1>  isrdpc.c
    1>  Generating Code...
    1>  PCIDRV.vcxproj -> C:\TEMP\pcidrv\kmdf\HW\Debug\PCIDRV.sys
    1>  PCIDRV.vcxproj -> Debug\PCIDRV.pdb (Full PDB)
    1>  Done Adding Additional Store
    1>  Successfully signed: C:\TEMP\pcidrv\kmdf\HW\Debug\PCIDRV.sys
    1>
    1>  ........................
    1>  Signability test complete.
    1>
    1>  Errors:
    1>  None
    1>
    1>  Warnings:
    1>  None
    1>
    1>  Catalog generation complete.
    1>  C:\TEMP\pcidrv\kmdf\HW\Debug\PCIDRV\kmdfsamples.cat
    1>  Done Adding Additional Store
    1>  Successfully signed: Debug\PCIDRV\kmdfsamples.cat
    1>
    ========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
    

    With kind regards

    Monday, September 12, 2016 11:19 PM

All replies

  • What is the actual compiler error message? Ignore the "underlines" for a moment and keep compiling.

    -- pa

    Monday, September 12, 2016 11:46 AM
  • sorry, my account not veryfied, so text cannot contain printscreen image, but here the log:

    1>------ Rebuild All started: Project: PCIDRV, Configuration: Debug Win32 ------
    1>  Building 'PCIDRV' with toolset 'WindowsKernelModeDriver10.0' and the 'Desktop' target platform.
    1>  Stamping .\Debug\\genpci.inf [Version] section with DriverVer=09/12/2016,15.2.15.55
    1>  Компилятор MOF (Майкрософт) версии 10.0.10586.117
    1>  (c) Корпорация Майкрософт, 1997-2006. Все права защищены.
    1>  Идет анализ MOF-файла: ..\pcidrv.mof
    1>  MOF-файл успешно проанализирован
    1>  Хранение двоичных MOF-данных в .\Debug\\pcidrv.bmf
    1>  Готово!
    1>  Binary mof file .\Debug\\pcidrv.bmf expanded to 1224 bytes
    1>  Microsoft (R) WDM Extensions To WMI MOF Checking Utility  Version 1.50.0000
    1>  Copyright (c) Microsoft Corp. 1997-2000. All rights reserved.
    1>
    1>  precompsrc.c
    1>  pcidrv.c
    1>..\pcidrv.c(119): error C4013: 'WPP_CALL_pcidrv_c119' undefined; assuming extern returning int
    1>..\pcidrv.c(119): error C2065: 'DBG_INIT': undeclared identifier
    1>..\pcidrv.c(144): error C4013: 'WPP_CALL_pcidrv_c144' undefined; assuming extern returning int
    .....
    1>..\pcidrv.c(1669): error C2065: 'DBG_PNP': undeclared identifier
    1>..\pcidrv.c(1684): error C4013: 'WPP_CALL_pcidrv_c1684' undefined; assuming extern returning int
    1>..\pcidrv.c(1684): error C2065: 'DBG_PNP': undeclared identifier
    1>  wmi.c
    1>  nic_init.c
    1>  eeprom.c
    1>  nic_recv.c
    1>  nic_send.c
    1>  routines.c
    1>  physet.c
    1>  nic_req.c
    1>  nic_pm.c
    1>  isrdpc.c
    1>  Generating Code...
    ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

    and, for example, in code:

    --*/
    {
        PFDO_DATA               fdoData = NULL;
    
        PAGED_CODE();
    
        fdoData = FdoGetData((WDFDEVICE)Device);
    
    // 1
        TraceEvents(TRACE_LEVEL_INFORMATION, DBG_PNP ,
                    "--> PciDrvEvtDeviceContextCleanup\n");
    
        NICFreeSoftwareResources(fdoData);
    
    // 2
        TraceEvents(TRACE_LEVEL_INFORMATION, DBG_PNP,
                    "<-- PciDrvEvtDeviceContextCleanup\n");
    
    }
    in first TraceEvents DBG_PNP underlined, in second - not.


    Monday, September 12, 2016 12:24 PM
  • For me, pcidrv.c from the Windows-driver-samples-master.zip  gives 

    1>------ Build started: Project: PCIDRV, Configuration: Debug Win32 ------
    1>  Building 'PCIDRV' with toolset 'WindowsKernelModeDriver10.0' and the 'Desktop' target platform.
    1>  Stamping .\Debug\\genpci.inf [Version] section with DriverVer=09/13/2016,0.50.15.453
    1>  Microsoft (R) MOF-Compiler, Version 10.0.14393.0
    1>  Copyright (c) Microsoft Corp. 1997-2006. Alle Rechte vorbehalten.
    1>  Die folgende MOF-Datei wird analysiert: ..\pcidrv.mof
    1>  Die MOF-Datei wurde erfolgreich verarbeitet.
    1>  Binäre MOF-Daten werden in .\Debug\\pcidrv.bmf gespeichert.
    1>  Fertig!
    1>  Microsoft (R) WDM Extensions To WMI MOF Checking Utility  Version 1.50.0000
    1>  Copyright (c) Microsoft Corp. 1997-2000. All rights reserved.
    1>
    1>  Binary mof file .\Debug\\pcidrv.bmf expanded to 1224 bytes
    1>  precompsrc.c
    1>  pcidrv.c
    1>..\pcidrv.c(118): error C4013: 'WPP_CALL_PCIDRV_C118' undefined; assuming extern returning int
    1>..\pcidrv.c(118): error C2065: 'DBG_INIT': undeclared identifier
    1>..\pcidrv.c(143): error C4013: 'WPP_CALL_PCIDRV_C143' undefined; assuming extern returning int
    1>..\pcidrv.c(143): error C2065: 'DBG_INIT': undeclared identifier
    ...
    1>..\pcidrv.c(1668): error C4013: 'WPP_CALL_PCIDRV_C1668' undefined; assuming extern returning int
    1>..\pcidrv.c(1668): error C2065: 'DBG_PNP': undeclared identifier
    1>..\pcidrv.c(1683): error C4013: 'WPP_CALL_PCIDRV_C1683' undefined; assuming extern returning int
    1>..\pcidrv.c(1683): error C2065: 'DBG_PNP': undeclared identifier
    1>  wmi.c
    1>  nic_init.c
    1>  eeprom.c
    1>  nic_recv.c
    1>  nic_send.c
    1>  routines.c
    1>  physet.c
    1>  nic_req.c
    1>  nic_pm.c
    1>  isrdpc.c
    1>  Generating Code...
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    After saving pcidrv.c with 'File->Advanced Save Options' (Windows 10 Anniversary german Target OS 10)

    - and enabling Inf2Cat 'Use Local Time' build seems to succeed:

    1>------ Rebuild All started: Project: PCIDRV, Configuration: Debug Win32 ------
    1>  Building 'PCIDRV' with toolset 'WindowsKernelModeDriver10.0' and the 'Desktop' target platform.
    1>  Stamping .\Debug\\genpci.inf [Version] section with DriverVer=09/13/2016,1.7.8.89
    1>  Microsoft (R) MOF-Compiler, Version 10.0.14393.0
    1>  Copyright (c) Microsoft Corp. 1997-2006. Alle Rechte vorbehalten.
    1>  Die folgende MOF-Datei wird analysiert: ..\pcidrv.mof
    1>  Die MOF-Datei wurde erfolgreich verarbeitet.
    1>  Binäre MOF-Daten werden in .\Debug\\pcidrv.bmf gespeichert.
    1>  Fertig!
    1>  Binary mof file .\Debug\\pcidrv.bmf expanded to 1224 bytes
    1>  Microsoft (R) WDM Extensions To WMI MOF Checking Utility  Version 1.50.0000
    1>  Copyright (c) Microsoft Corp. 1997-2000. All rights reserved.
    1>
    1>  precompsrc.c
    1>  pcidrv.c
    1>  wmi.c
    1>  nic_init.c
    1>  eeprom.c
    1>  nic_recv.c
    1>  nic_send.c
    1>  routines.c
    1>  physet.c
    1>  nic_req.c
    1>  nic_pm.c
    1>  isrdpc.c
    1>  Generating Code...
    1>  PCIDRV.vcxproj -> C:\TEMP\pcidrv\kmdf\HW\Debug\PCIDRV.sys
    1>  PCIDRV.vcxproj -> Debug\PCIDRV.pdb (Full PDB)
    1>  Done Adding Additional Store
    1>  Successfully signed: C:\TEMP\pcidrv\kmdf\HW\Debug\PCIDRV.sys
    1>
    1>  ........................
    1>  Signability test complete.
    1>
    1>  Errors:
    1>  None
    1>
    1>  Warnings:
    1>  None
    1>
    1>  Catalog generation complete.
    1>  C:\TEMP\pcidrv\kmdf\HW\Debug\PCIDRV\kmdfsamples.cat
    1>  Done Adding Additional Store
    1>  Successfully signed: Debug\PCIDRV\kmdfsamples.cat
    1>
    ========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
    

    With kind regards

    Monday, September 12, 2016 11:19 PM
  • MaybeCompletelyWPavel A, all fine, thanks.
    • Edited by cherniko Tuesday, September 13, 2016 9:37 AM
    Tuesday, September 13, 2016 9:26 AM