Build-PowerMonkey icon indicating copy to clipboard operation
Build-PowerMonkey copied to clipboard

Error on build

Open oliveirarafa opened this issue 3 years ago • 6 comments

I'm getting this error when I try to build.

image

I opened with Developer Command Prompt VS2019 and 2022, but always get the same error.

Also I had some errors with curl certificates but it might be a problem with my machine.

image

oliveirarafa avatar Mar 03 '22 22:03 oliveirarafa

I have this issue when I writing the scripts. This is an issue that Python could not load some packages.

Did you run setup.bat?

awyl avatar Mar 07 '22 21:03 awyl

Yes. When running the setup.bat I have the same output as #8.

To run the setup.bat I install the VS Studio 2022 and run the command prompt from there.

Edit: Actually i'm using the Visual Studio Developer Command Prompt. Is this a different prompt?

Edit2: They were 2 different prompts. I'm don't usually use VS Studio so I got confused.

Even after using the correct prompt I had some issues. I was having problems downloading things with curl so I manually downloaded and placed the files at the correct folders. After this, running setup returned these errors:

image

oliveirarafa avatar Mar 08 '22 02:03 oliveirarafa

I think we need a flag to not let warnings be considered as errors

EDIT: manually altering BaseTools/Source/C/Makefiles/ms.rule to

## @file
# Makefile
#
# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#

#DEPFILES = $(OBJECTS:%.o=%.d)

.c.obj :
	$(CC) -c /nologo /Zi /c /O2 /MT /W4 /D _CRT_SECURE_NO_DEPRECATE $(INC) $< -Fo$@

.S.obj :
	$(AS) -c $(ASFLAGS) $< -Fo$@

.cpp.obj :
	$(CXX) -c $(CPPFLAGS) $(INC) $< -Fo$@

#-include $(DEPFILES)

partially fixed the build issue, but now I'm receiving the following error:

D:\Development\Frameworks\Build-PowerMonkey\edk2\BaseTools\Source\C\Include\IndustryStandard/PeImage.h(662): error C2371: 'RUNTIME_FUNCTION': redefinition; different basic types
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winnt.h(4025): note: see declaration of 'RUNTIME_FUNCTION'

lucas-zimerman avatar Mar 23 '22 00:03 lucas-zimerman

I managed to successfully build my config by doing 2 things:

  1. I used the Visual Studio Developer Command Prompt 2019
  2. Included at the beginning of setup.bat and build.bat:
set EDK_TOOLS_BIN=D:\Projetos\Build-PowerMonkey\edk2\BaseTools\Bin\Win32

oliveirarafa avatar Mar 23 '22 15:03 oliveirarafa

I've got this error: ######################

Build libraries

######################

Microsoft (R) Program Maintenance Utility, Version 14.31.31107.0 Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.

    cl.exe -c  /nologo /Zi /c /O2 /MT /W4 /WX /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /nologo /Zi /c /O2 /MT /W4 /WX /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE  -I . -I C:\Users\Andreas\Downloads\Powermonkey\Build-PowerMonkey\edk2\BaseTools\Source\C\Include -I C:\Users\Andreas\Downloads\Powermonkey\Build-PowerMonkey\edk2\BaseTools\Source\C\Include\Ia32 -I C:\Users\Andreas\Downloads\Powermonkey\Build-PowerMonkey\edk2\BaseTools\Source\C\Common -I . -I C:\Users\Andreas\Downloads\Powermonkey\Build-PowerMonkey\edk2\BaseTools\Source\C\Include -I C:\Users\Andreas\Downloads\Powermonkey\Build-PowerMonkey\edk2\BaseTools\Source\C\Include\Ia32 -I C:\Users\Andreas\Downloads\Powermonkey\Build-PowerMonkey\edk2\BaseTools\Source\C\Common BasePeCoff.c -FoBasePeCoff.obj

BasePeCoff.c BasePeCoff.c(129): error C2220: Die folgende Warnung wird als Fehler behandelt. BasePeCoff.c(129): warning C4311: "Typumwandlung": Zeigerverkürzung von "void *" zu "UINTN" BasePeCoff.c(129): warning C4312: "Typumwandlung": Konvertierung von "UINTN" in größeren Typ "EFI_IMAGE_OPTIONAL_HEADER_UNION *" BasePeCoff.c(561): warning C4312: "Typumwandlung": Konvertierung von "UINTN" in größeren Typ "UINT8 *" BasePeCoff.c(629): warning C4312: "Typumwandlung": Konvertierung von "UINTN" in größeren Typ "EFI_IMAGE_OPTIONAL_HEADER_UNION *" BasePeCoff.c(703): warning C4312: "Typumwandlung": Konvertierung von "UINTN" in größeren Typ "EFI_TE_IMAGE_HEADER *" BasePeCoff.c(717): warning C4312: "Typumwandlung": Konvertierung von "UINTN" in größeren Typ "EFI_IMAGE_BASE_RELOCATION *" BasePeCoff.c(718): warning C4311: "Typumwandlung": Zeigerverkürzung von "EFI_IMAGE_BASE_RELOCATION *" zu "UINTN" BasePeCoff.c(718): warning C4312: "Typumwandlung": Konvertierung von "UINTN" in größeren Typ "EFI_IMAGE_BASE_RELOCATION *" BasePeCoff.c(740): warning C4312: "Typumwandlung": Konvertierung von "UINTN" in größeren Typ "CHAR8 *" BasePeCoff.c(743): warning C4312: "Typumwandlung": Konvertierung von "UINTN" in größeren Typ "CHAR8 *" BasePeCoff.c(745): warning C4312: "Typumwandlung": Konvertierung von "UINTN" in größeren Typ "CHAR8 *" BasePeCoff.c(782): warning C4311: "Typumwandlung": Zeigerverkürzung von "CHAR8 *" zu "UINTN" BasePeCoff.c(792): warning C4311: "Typumwandlung": Zeigerverkürzung von "CHAR8 *" zu "UINTN" BasePeCoff.c(954): warning C4312: "Typumwandlung": Konvertierung von "UINTN" in größeren Typ "void *" BasePeCoff.c(957): warning C4312: "Typumwandlung": Konvertierung von "UINTN" in größeren Typ "EFI_IMAGE_OPTIONAL_HEADER_UNION *" BasePeCoff.c(975): warning C4312: "Typumwandlung": Konvertierung von "UINTN" in größeren Typ "void *" BasePeCoff.c(977): warning C4312: "Typumwandlung": Konvertierung von "UINTN" in größeren Typ "EFI_TE_IMAGE_HEADER *" BasePeCoff.c(1017): warning C4311: "Typumwandlung": Zeigerverkürzung von "CHAR8 *" zu "UINTN" BasePeCoff.c(1018): warning C4311: "Typumwandlung": Zeigerverkürzung von "CHAR8 *" zu "UINTN" BasePeCoff.c(1077): warning C4311: "Typumwandlung": Zeigerverkürzung von "void *" zu "UINTN" BasePeCoff.c(1135): warning C4312: "Typumwandlung": Konvertierung von "UINTN" in größeren Typ "EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *" BasePeCoff.c(1158): warning C4312: "Typumwandlung": Konvertierung von "UINTN" in größeren Typ "void *" BasePeCoff.c(1273): warning C4311: "Typumwandlung": Zeigerverkürzung von "void *" zu "UINTN" BasePeCoff.c(1273): warning C4312: "Typumwandlung": Konvertierung von "UINTN" in größeren Typ "EFI_IMAGE_NT_HEADERS32 *"BasePeCoff.c(1294): warning C4311: "Typumwandlung": Zeigerverkürzung von "EFI_TE_IMAGE_HEADER *" zu "UINTN" BasePeCoff.c(1298): warning C4312: "Typumwandlung": Konvertierung von "UINTN" in größeren Typ "EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *" BasePeCoff.c(1363): warning C4311: "Typumwandlung": Zeigerverkürzung von "void *" zu "UINTN" BasePeCoff.c(1366): warning C4312: "Typumwandlung": Konvertierung von "UINTN" in größeren Typ "EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *" BasePeCoff.c(1393): warning C4311: "Typumwandlung": Zeigerverkürzung von "void *" zu "UINTN" BasePeCoff.c(1397): warning C4312: "Typumwandlung": Konvertierung von "UINTN" in größeren Typ "void *" BasePeCoff.c(1441): warning C4311: "Typumwandlung": Zeigerverkürzung von "void *" zu "UINTN" BasePeCoff.c(1441): warning C4312: "Typumwandlung": Konvertierung von "UINTN" in größeren Typ "EFI_IMAGE_NT_HEADERS32 *"BasePeCoff.c(1454): warning C4312: "Typumwandlung": Konvertierung von "UINTN" in größeren Typ "void *" BasePeCoff.c(1455): warning C4311: "Typumwandlung": Zeigerverkürzung von "void *" zu "UINTN" BasePeCoff.c(1458): warning C4312: "Typumwandlung": Konvertierung von "UINT32" in größeren Typ "void *" BasePeCoff.c(1460): warning C4312: "Typumwandlung": Konvertierung von "UINT32" in größeren Typ "void *" BasePeCoff.c(1462): warning C4312: "Typumwandlung": Konvertierung von "UINTN" in größeren Typ "void *" BasePeCoff.c(1464): warning C4311: "Typumwandlung": Zeigerverkürzung von "void *" zu "UINTN" BasePeCoff.c(1464): warning C4311: "Typumwandlung": Zeigerverkürzung von "void *" zu "UINTN" BasePeCoff.c(1464): warning C4312: "Typumwandlung": Konvertierung von "UINTN" in größeren Typ "void *" NMAKE : fatal error U1077: ""C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\bin\HostX64\x64\cl.exe"": Rückgabe-Code "0x2" Stop. NMAKE : fatal error U1077: "if": Rückgabe-Code "0x1" Stop. NMAKE : fatal error U1077: "if": Rückgabe-Code "0x1" Stop.

!!! WARNING !!! CLANG_BIN environment variable is not set

!!! WARNING !!! No CYGWIN_HOME set, gcc build may not be used !!!

And installed VS2022 Community Edition with this options: grafik

Why is it not building. Please help. Thanks!

emc02 avatar May 03 '22 12:05 emc02

When using "Native Tools Command Prompt for VS 2022" without "x64" it worked well. So I think using the "x86 Native Tools Command Prompt for VS 2022" is better?

emc02 avatar May 03 '22 16:05 emc02