libwiigui icon indicating copy to clipboard operation
libwiigui copied to clipboard

Linking problems

Open koopthekoopa opened this issue 3 years ago • 3 comments

I tried to compile libwiigui and it compiled the files but when it links to elf file it displays this: C:/devkitPro/portlibs/ppc/lib\libvorbisidec.a(info.o): In function tagcompare': info.c:(.text+0x40): undefined reference to __locale_ctype_ptr' info.c:(.text+0x70): undefined reference to __locale_ctype_ptr' info.c:(.text+0x90): undefined reference to __locale_ctype_ptr' C:/devkitPro/portlibs/ppc/lib\libfreetype.a(ftbzip2.o): In function ft_bzip2_stream_close': ftbzip2.c:(.text+0x3c): undefined reference to BZ2_bzDecompressEnd' C:/devkitPro/portlibs/ppc/lib\libfreetype.a(ftbzip2.o): In function ft_bzip2_file_fill_output': ftbzip2.c:(.text+0x110): undefined reference to BZ2_bzDecompress' C:/devkitPro/portlibs/ppc/lib\libfreetype.a(ftbzip2.o): In function ft_bzip2_stream_io': ftbzip2.c:(.text+0x3bc): undefined reference to BZ2_bzDecompressEnd' ftbzip2.c:(.text+0x3f4): undefined reference to BZ2_bzDecompressInit' C:/devkitPro/portlibs/ppc/lib\libfreetype.a(ftbzip2.o): In function FT_Stream_OpenBzip2': ftbzip2.c:(.text+0x668): undefined reference to `BZ2_bzDecompressInit' collect2: ld returned 1 exit status make[1]: *** [/opt/devkitpro/devkitPPC/wii_rules:25: /c/Libwiigui/libwiigui-demo.elf] Error 1 make: *** [Makefile:101: build] Error 2

is there a way to fix this?

koopthekoopa avatar May 06 '21 20:05 koopthekoopa

Do you have an old portlibs setup? Reinstall ppc-libvorbisidec, the first problem should go away then.

About the second issue: Can you post the output of this command?

$DEVKITPRO/portlibs/ppc/bin/freetype-config --libs

If it works correctly, it should include -lbz2. Otherwise, try reinstalling ppc-freetype.

carstene1ns avatar May 13 '21 10:05 carstene1ns

Bumping this old thread to say I also get undefined reference issue during build, specifically to these four variables:

  • font_ttf_size
  • bg_music_ogg_size
  • button_over_pcm_size
  • button_click_pcm_size

If I manually replace every reference to these in the code with the values found in the build directory, everything works. I have no idea why only these are affected.

-lb2 is included in the output of $DEVKITPRO/portlibs/ppc/bin/freetype-config --libs.

I have this exact same problem (the same four variables) on two different devices (1 Windows and 1 Arch Linux) on two completely independent environments.

Spatchy avatar Jan 09 '24 17:01 Spatchy

@Spatchy: you need to apply #28 locally.

carstene1ns avatar Jan 09 '24 22:01 carstene1ns

(sorry for being very late) I just had a broken devkitPro install cause, to be honest, I had no idea what I was doing back then. But after knowing what to do, it's all working now! (I've also apply the pull #28 to fix the undefined reference issues)

koopthekoopa avatar Jun 07 '24 19:06 koopthekoopa