OSDev.org

The Place to Start for Operating System Developers
It is currently Tue Mar 19, 2024 4:52 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Error while compiling a UEFI application
PostPosted: Wed Jan 04, 2023 9:35 pm 
Offline

Joined: Sun Aug 22, 2021 3:11 pm
Posts: 17
Location: Germany
Hello I am currently trying out a lot with gnu-efi and came up with the idea to output a png image on the screen. Now I have an error message when linking the efi application.

The following error:

Quote:
ld: Build/main.o:(.bss+0x0): multiple definition of `stbi__g_failure_reason'; Build/Images/png.o:(.bss+0x0): first defined here
ld: Build/main.o: in function `stbi_zlib_decode_malloc_guesssize_headerflag':
main.c:(.text+0x201f): multiple definition of `stbi_zlib_decode_malloc_guesssize_headerflag'; Build/Images/png.o:png.c:(.text+0x201f): first defined here
ld: Build/main.o: in function `stbi__png_load':
main.c:(.text+0x4b8d): multiple definition of `stbi__png_load'; Build/Images/png.o:png.c:(.text+0x4b8d): first defined here
make: *** [Makefile:16: efi] Error 1


My Source code: https://github.com/rxbin1201/Bootloader

I hopy anyone can help me with my problem.


Top
 Profile  
 
 Post subject: Re: Error while compiling a UEFI application
PostPosted: Wed Jan 04, 2023 10:08 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5069
According to the readme for your PNG decoder, you're using it incorrectly. You're supposed to define STB_IMAGE_IMPLEMENTATION only once, in the source file that will be compiled into the PNG decoder object file. You're defining it in every source file that includes png.h, which results in multiple copies of the PNG decoder and thus duplicate symbols.


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: Bing [Bot] and 23 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