OSDev.org

The Place to Start for Operating System Developers
It is currently Sat Apr 27, 2024 7:15 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Mingw GCC Undefined references to LIB EFI
PostPosted: Wed Dec 13, 2023 5:57 am 
Offline

Joined: Tue Dec 12, 2023 9:36 pm
Posts: 1
For the past couple days I've been trying to get Mingw GCC Working with GNU-EFI, Whenever I try to compile using function from libefi.h I get errors:
Code:
/usr/lib/gcc/x86_64-w64-mingw32/13.1.0/../../../../x86_64-w64-mingw32/bin/ld: /tmp/ccUyeC4u.o:main.c:(.text+0x1c): undefined reference to `InitializeLib'
/usr/lib/gcc/x86_64-w64-mingw32/13.1.0/../../../../x86_64-w64-mingw32/bin/ld: /tmp/ccUyeC4u.o:main.c:(.text+0x2b): undefined reference to `Print'


This is my Makefile
Code:
gcc:
   x86_64-w64-mingw32-gcc main.c \
   -std=c17 \
   -Wall \
   -Wpedantic \
   -mno-red-zone \
   -ffreestanding \
   -nostdlib \
   -I /usr/include/efi \
   -I /usr/include/efi/x86_64 \
   -L /usr/lib
   -Wl,--subsystem,10 \
   -e efi_main \
   -o main.efi


Top
 Profile  
 
 Post subject: Re: Mingw GCC Undefined references to LIB EFI
PostPosted: Tue Feb 13, 2024 2:21 am 
Offline
Member
Member

Joined: Wed Mar 30, 2011 12:31 am
Posts: 676
I apologize for the delay in approving your post.

GNU-EFI is not intended to be used with Mingw: It is a build system for using an ELF toolchain to create EFI binaries.

You are referencing library functions from the included EFILIB - if you want to use these functions outside of GNU-EFI, you must build it separately from source and then link with it.

_________________
toaruos on github | toaruos.org | gitlab | twitter | bim - a text editor


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Amazonbot [bot], eekee and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group