0
votes

I am using gnu-efi as Visual Studio 2019 project. My UEFI program works as expected on real hardware. Next step, I need C features like "pow(...);". Naturally, when working with efi all of these features are disabled. When I directly include <math.h> I get unresolved external ... error. If I start a unrestricted project that builds successfully.

I asked it and someone advised met to downolad EDK2 libc but I do not know how to use it in my project or if that works with GNU-EFI. I have no idea what to do in order to use C features. I will very glad if anyone tells me what to do.

1
If you use edk2, it will be instead gnuefi, not aside. If I were you, I'd rephrase the question, because you don't want to use C features, but standard libc features. I cannot really answer your question, except that, imho, if you only need a few features like pow in your efi programm, you'd better re-create it yourself than include a full library. - Stéphane Veyret
UEFI does not have a standard C runtime library, so you cannot use C features like math.h directly. If you only need a simple subset of it like pow, I think it's better to implement it yourself. - KagurazakaKotori
@KagurazakaKotori Yes, in the end I did it like that. Someone advised me to use edk2-libc on gnu-efi github page but I do not know how that is possible. - Gomi Odabaşıoğlu

1 Answers

0
votes

Here is the libc that is ported to UEFI.