构建失败 EDK2

问题描述 投票:0回答:1

我得到:

d:\edk2\SetVariablePkg\SetVariablePkg.dsc(...): error 4000: Instance of library class [OpensslLib] is not found
        in [d:\edk2\CryptoPkg\Library\BaseCryptLib\BaseCryptLib.inf] [X64]
        consumed by module [d:\edk2\SetVariablePkg\SetVariable.inf]

当我尝试编译我的 EDK2 项目时。 我正在尝试使用

RandomBytes()
函数,因此我包含了
<Library/BaseCryptLib.h>
。这就是我的 .dsc 文件的样子:

[Defines]
    PLATFORM_NAME = SetVariablePkg
    PLATFORM_GUID = 4E85F56A-569F-41FC-AA95-C0C42519E406
    PLATFORM_VERSION = 0.1
    DSC_SPECIFICATION = 0x00010005
    SUPPORTED_ARCHITECTURES = X64
    BUILD_TARGETS = DEBUG|RELEASE
    OUTPUT_DIRECTORY = SetVariablePkg/Build

[LibraryClasses]
    UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
    UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf
    PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
    PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
    MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
    DebugLib|MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf
    BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
    BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
    UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
    DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
    UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
    RegisterFilterLib|MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.inf
    DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
    BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf

[Components]
    SetVariablePkg/SetVariable.inf

这就是我的 .inf 文件的样子:

[Defines]
    INF_VERSION = 0x00010006
    BASE_NAME = SetVariable
    FILE_GUID = 53EF0710-78CA-40EF-AFF8-CAC311DBEB38
    MODULE_TYPE = UEFI_APPLICATION
    VERSION_STRING = 0.1
    ENTRY_POINT = UefiMain

[Sources]
    SetVariable.c
    SetVariable.h

[Packages]
    MdePkg/MdePkg.dec

[LibraryClasses]
    UefiLib
    MemoryAllocationLib
    UefiBootServicesTableLib
    UefiApplicationEntryPoint
    UefiRuntimeServicesTableLib
    BaseCryptLib

[Protocols]
    gEfiSimpleTextInputExProtocolGuid

这些是我在头文件中的包含内容:

#include <Uefi.h>
#include <Library/UefiLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/BaseCryptLib.h>
#include <Protocol/Variable.h>

#define Buffer 256

我使用的是Windows 10,使用VS2019编译器。有谁知道我该如何修复这个错误?

c firmware uefi edk2
1个回答
0
投票

错误消息表明您错过了在 .dsc 文件中定义库“OpensslLib”的实例。

您可以在 .dsc 文件中定义 OpensslLib,如下所示

OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf

对于新的类似错误,您可以在其他 .dsc 文件上搜索参考。

© www.soinside.com 2019 - 2024. All rights reserved.