Я не могу скомпилировать свой проект, который использует C ++ / WinRT после обновления до Windows 10, версия 1809 SDK - PullRequest
0 голосов
/ 18 октября 2018

Когда я обновляю Windows SDK до 17763, я обнаружил, что не могу скомпилировать свой проект, и я получаю сообщение об ошибке: «midl: ошибка MIDL9008: внутренняя проблема компилятора» - см. Документацию для предложений о том, как найти обходной путь.».Вот вывод:

1>Note: The Microsoft.Windows.CppWinRT Nuget package provides improved C++/WinRT project build support.
1>64 bit MIDLRT Processing G:\NagisaRepositories\Nagisa\Assassin\CustomConverter.idl
1>CustomConverter.idl
1>64 bit MIDLRT Processing C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\winrt\winrtbase.idl
1>winrtbase.idl
1>64 bit MIDLRT Processing C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\winrt\midlbase.idl
1>midlbase.idl
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.ai.machinelearning.machinelearningcontract\1.0.0.0\windows.ai.machinelearning.machinelearningcontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.ai.machinelearning.preview.machinelearningpreviewcontract\2.0.0.0\windows.ai.machinelearning.preview.machinelearningpreviewcontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.applicationmodel.calls.background.callsbackgroundcontract\1.0.0.0\windows.applicationmodel.calls.background.callsbackgroundcontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.applicationmodel.calls.callsphonecontract\4.0.0.0\windows.applicationmodel.calls.callsphonecontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.applicationmodel.calls.callsvoipcontract\4.0.0.0\windows.applicationmodel.calls.callsvoipcontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.applicationmodel.communicationblocking.communicationblockingcontract\2.0.0.0\windows.applicationmodel.communicationblocking.communicationblockingcontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.applicationmodel.socialinfo.socialinfocontract\2.0.0.0\windows.applicationmodel.socialinfo.socialinfocontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.applicationmodel.startuptaskcontract\3.0.0.0\windows.applicationmodel.startuptaskcontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.devices.custom.customdevicecontract\1.0.0.0\windows.devices.custom.customdevicecontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.devices.deviceslowlevelcontract\3.0.0.0\windows.devices.deviceslowlevelcontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.devices.printers.printerscontract\1.0.0.0\windows.devices.printers.printerscontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.devices.smartcards.smartcardbackgroundtriggercontract\3.0.0.0\windows.devices.smartcards.smartcardbackgroundtriggercontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.devices.smartcards.smartcardemulatorcontract\6.0.0.0\windows.devices.smartcards.smartcardemulatorcontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.foundation.foundationcontract\3.0.0.0\windows.foundation.foundationcontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.foundation.universalapicontract\7.0.0.0\windows.foundation.universalapicontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.gaming.xboxlive.storageapicontract\1.0.0.0\windows.gaming.xboxlive.storageapicontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.graphics.printing3d.printing3dcontract\4.0.0.0\windows.graphics.printing3d.printing3dcontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.networking.connectivity.wwancontract\2.0.0.0\windows.networking.connectivity.wwancontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.networking.sockets.controlchanneltriggercontract\3.0.0.0\windows.networking.sockets.controlchanneltriggercontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.services.maps.guidancecontract\3.0.0.0\windows.services.maps.guidancecontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.services.maps.localsearchcontract\4.0.0.0\windows.services.maps.localsearchcontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.services.store.storecontract\4.0.0.0\windows.services.store.storecontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.services.targetedcontent.targetedcontentcontract\1.0.0.0\windows.services.targetedcontent.targetedcontentcontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.system.profile.profilehardwaretokencontract\1.0.0.0\windows.system.profile.profilehardwaretokencontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.system.profile.profilesharedmodecontract\2.0.0.0\windows.system.profile.profilesharedmodecontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.system.profile.systemmanufacturers.systemmanufacturerscontract\3.0.0.0\windows.system.profile.systemmanufacturers.systemmanufacturerscontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.system.systemmanagementcontract\6.0.0.0\windows.system.systemmanagementcontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.ui.viewmanagement.viewmanagementviewscalingcontract\1.0.0.0\windows.ui.viewmanagement.viewmanagementviewscalingcontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.ui.xaml.core.direct.xamldirectcontract\1.0.0.0\windows.ui.xaml.core.direct.xamldirectcontract.winmd
1>64 bit MIDLRT Processing G:\NagisaRepositories\Nagisa\Assassin\TransferManager.idl
1>TransferManager.idl
1>64 bit MIDLRT Processing C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\winrt\winrtbase.idl
1>winrtbase.idl
1>64 bit MIDLRT Processing C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\winrt\midlbase.idl
1>midlbase.idl
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.ai.machinelearning.machinelearningcontract\1.0.0.0\windows.ai.machinelearning.machinelearningcontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.ai.machinelearning.preview.machinelearningpreviewcontract\2.0.0.0\windows.ai.machinelearning.preview.machinelearningpreviewcontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.applicationmodel.calls.background.callsbackgroundcontract\1.0.0.0\windows.applicationmodel.calls.background.callsbackgroundcontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.applicationmodel.calls.callsphonecontract\4.0.0.0\windows.applicationmodel.calls.callsphonecontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.applicationmodel.calls.callsvoipcontract\4.0.0.0\windows.applicationmodel.calls.callsvoipcontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.applicationmodel.communicationblocking.communicationblockingcontract\2.0.0.0\windows.applicationmodel.communicationblocking.communicationblockingcontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.applicationmodel.socialinfo.socialinfocontract\2.0.0.0\windows.applicationmodel.socialinfo.socialinfocontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.applicationmodel.startuptaskcontract\3.0.0.0\windows.applicationmodel.startuptaskcontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.devices.custom.customdevicecontract\1.0.0.0\windows.devices.custom.customdevicecontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.devices.deviceslowlevelcontract\3.0.0.0\windows.devices.deviceslowlevelcontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.devices.printers.printerscontract\1.0.0.0\windows.devices.printers.printerscontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.devices.smartcards.smartcardbackgroundtriggercontract\3.0.0.0\windows.devices.smartcards.smartcardbackgroundtriggercontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.devices.smartcards.smartcardemulatorcontract\6.0.0.0\windows.devices.smartcards.smartcardemulatorcontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.foundation.foundationcontract\3.0.0.0\windows.foundation.foundationcontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.foundation.universalapicontract\7.0.0.0\windows.foundation.universalapicontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.gaming.xboxlive.storageapicontract\1.0.0.0\windows.gaming.xboxlive.storageapicontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.graphics.printing3d.printing3dcontract\4.0.0.0\windows.graphics.printing3d.printing3dcontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.networking.connectivity.wwancontract\2.0.0.0\windows.networking.connectivity.wwancontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.networking.sockets.controlchanneltriggercontract\3.0.0.0\windows.networking.sockets.controlchanneltriggercontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.services.maps.guidancecontract\3.0.0.0\windows.services.maps.guidancecontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.services.maps.localsearchcontract\4.0.0.0\windows.services.maps.localsearchcontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.services.store.storecontract\4.0.0.0\windows.services.store.storecontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.services.targetedcontent.targetedcontentcontract\1.0.0.0\windows.services.targetedcontent.targetedcontentcontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.system.profile.profilehardwaretokencontract\1.0.0.0\windows.system.profile.profilehardwaretokencontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.system.profile.profilesharedmodecontract\2.0.0.0\windows.system.profile.profilesharedmodecontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.system.profile.systemmanufacturers.systemmanufacturerscontract\3.0.0.0\windows.system.profile.systemmanufacturers.systemmanufacturerscontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.system.systemmanagementcontract\6.0.0.0\windows.system.systemmanagementcontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.ui.viewmanagement.viewmanagementviewscalingcontract\1.0.0.0\windows.ui.viewmanagement.viewmanagementviewscalingcontract.winmd
1>Processing WinMD c:\program files (x86)\windows kits\10\references\10.0.17763.0\windows.ui.xaml.core.direct.xamldirectcontract\1.0.0.0\windows.ui.xaml.core.direct.xamldirectcontract.winmd
1>
1>midl : error MIDL9008: internal compiler problem - See documentation for suggestions on how to find a workaround.
1>midl: Assertion failed: false, file com\rpc\midl\midlrt\inc\nodeskl.hxx, line 4884

Я попытался решить проблему, и я обнаружил, что она успешно скомпилируется, если я удалю определения интерфейса.Но мне нужны эти определения, потому что это важно.Вот определения IDL, которые я удалил.

/******************************************************************************
Project: Assassin
Description: Definition for the TransferManager.
File Name: TransferManager.idl
License: The MIT License
******************************************************************************/

namespace Assassin
{
    enum TransferTaskStatus
    {
        Canceled  = 0,
        Completed = 1,
        Error     = 2,
        Paused    = 3,
        Queued    = 4,
        Running   = 5
    };

    [version(1.0)]
    [uuid(B70ACDED-7354-3082-BF73-D931D80C047B)]
    interface ITransferTask : IInspectable
        requires Windows.UI.Xaml.Data.INotifyPropertyChanged
    {
        // Gets the Guid string of the task.
        String Guid
        {
            get;
        };

        // Gets the URI which to download the file.
        Windows.Foundation.Uri SourceUri
        {
            get;
        };

        // Gets the file name which to download the file.
        String FileName
        {
            get;
        };

        // Gets the save file object which to download the file.
        Windows.Storage.IStorageFile SaveFile
        {
            get;
        };

        // Gets the save folder object which to download the file.
        Windows.Storage.IStorageFolder SaveFolder
        {
            get;
        };

        // The current status of the task.
        TransferTaskStatus Status
        {
            get;
        };

        // The total number of bytes received. This value does not include 
        // bytes received as response headers. If the task has restarted, 
        // this value may be smaller than in the previous progress report.
        UInt64 BytesReceived
        {
            get;
        };

        // The speed of bytes received in one second.
        UInt64 BytesReceivedSpeed
        {
            get;
        };

        // The remain time, in seconds.
        UInt64 RemainTime
        {
            get;
        };

        // The total number of bytes of data to download. If this number is
        // unknown, this value is set to 0.
        UInt64 TotalBytesToReceive
        {
            get;
        };

        // Pauses a download operation.
        // Parameters:
        //   The function does not have parameters.
        // Return value:
        //   The function does not return a value.
        void Pause();

        // Resumes a paused download operation.
        // Parameters:
        //   The function does not have parameters.
        // Return value:
        //   The function does not return a value.
        void Resume();

        // Cancels a download operation.
        // Parameters:
        //   The function does not have parameters.
        // Return value:
        //   The function does not return a value.
        void Cancel();
    }

    typedef Windows.Foundation.Collections.IVectorView<ITransferTask> ITransferTaskVector;

    [version(1.0)]
    [uuid(976D09B5-65EE-39DE-9C00-26E47D6538D7)] 
    interface ITransferManager : IInspectable
        requires 
            Windows.Foundation.IClosable, 
            Windows.UI.Xaml.Data.INotifyPropertyChanged
    {
        // Gets the version of Nagisa.
        String Version
        {
            get;
        };

        // Gets or sets the filter to use for searching the task list.
        String SearchFilter
        {
            get;
            set;
        };

        // Gets the last used folder.
        Windows.Storage.IStorageFolder LastusedFolder
        {
            get;
        };

        // Gets or sets the default download folder.
        Windows.Storage.IStorageFolder DefaultFolder
        {
            get;
            set;
        };

        // Gets the total download bandwidth.
        UInt64 TotalDownloadBandwidth
        {
            get;
        };

        // Gets the total upload bandwidth.
        UInt64 TotalUploadBandwidth
        {
            get;
        };

        // Gets the task list.
        // Parameters:
        //   The function does not have parameters.
        // Return value:
        //   Returns an object which represents the task list.
        Windows.Foundation.IAsyncOperation<ITransferTaskVector> GetTasksAsync();

        // Add a task to the task list.
        // Parameters:
        //   SourceUri: The source uri object of task.
        //   DesiredFileName: The file name you desire.
        //   SaveFolder: The object of the folder which you want to save.
        // Return value:
        //   Returns an asynchronous object used to wait.
        Windows.Foundation.IAsyncAction AddTaskAsync(
            Windows.Foundation.Uri SourceUri,
            String DesiredFileName,
            Windows.Storage.IStorageFolder SaveFolder);

        // Removes a task to the task list.
        // Parameters:
        //   Task: The task object. 
        // Return value:
        //   Returns an asynchronous object used to wait.
        Windows.Foundation.IAsyncAction RemoveTaskAsync(
            ITransferTask Task);

        // Start all tasks.
        // Parameters:
        //   The function does not have parameters.
        // Return value:
        //   The function does not return a value.
        void StartAllTasks();

        // Pause all tasks.
        // Parameters:
        //   The function does not have parameters.
        // Return value:
        //   The function does not return a value.
        void PauseAllTasks();

        // Clears the task list.
        // Parameters:
        //   The function does not have parameters.
        // Return value:
        //   The function does not return a value.
        void ClearTaskList();
    }

    [version(1.0)]
    runtimeclass TransferManager :
        [default] ITransferManager
    {
        // Creates a new TransferManager object.
        // Parameters:
        //   EnableUINotify: Enable the UI notify timer if true. 
        // Return value:
        //   The function does not return a value.
        TransferManager(
            Boolean EnableUINotify);
    }
}

Я хочу знать, что вызвало это, моя ошибка или Windows SDK.

Ответы [ 2 ]

0 голосов
/ 18 марта 2019

После нескольких дней работы над этой проблемой, пытаясь найти решение, обходной путь оказался чрезвычайно простым:

namespace System {
    typedef Windows.Foundation.IClosable IDisposable;
}
namespace MyComponent.MyNamespace {
    interface IMyInterface : IInspectable requires System.IDisposable {
        ...
    }
}

Приведенный выше typedef можно поместить в отдельный общий ресурс.файл idl, который может быть включен всякий раз, когда требуется извлечение внешнего интерфейса.

0 голосов
/ 24 октября 2018

Я хочу знать, что вызвало это, моя ошибка или Windows SDK.

Это известная ошибка в компиляторе MIDL, который поставляется с последней версией Windows SDK.

...