Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile Errors #111

Open
superbeelavaman opened this issue Feb 5, 2025 · 3 comments
Open

Compile Errors #111

superbeelavaman opened this issue Feb 5, 2025 · 3 comments

Comments

@superbeelavaman
Copy link

I am currently attempting to compile Wii64 from source, however it is failing in file main/rom_gc.c.
This is the output:

$ make -f Makefile.Rice_wii
...
(a whole bunch of warnings)
...
powerpc-eabi-gcc -DRICE_GFX -DWII -DHW_RVL -DUSE_EXPANSION -D__wii__ -g -O3  -Wall -Wno-parentheses -Wno-unused-parameter -pipe -mcpu=750 -meabi -mhard-float  -I/opt/devkitpro/libogc2/include -I/opt/devkitpro/portlibs/ppc/include -DGEKKO -D__GX__ -DUSE_GUI -DRELEASE -DMENU_V2 -DTHREADED_AUDIO -DUSE_RECOMP_CACHE -DPPC_DYNAREC -DFASTMEM -DNO_ASM    -fgnu89-inline -Wno-multichar   -c -o main/rom_gc.o main/rom_gc.c
main/rom_gc.c: In function 'rom_read':
main/rom_gc.c:153:18: error: passing argument 1 of 'ROMCache_read' from incompatible pointer type [-Wincompatible-pointer-types]
  153 |    ROMCache_read(&ROM_HEADER, 0, sizeof(rom_header));
      |                  ^~~~~~~~~~~
      |                  |
      |                  rom_header * {aka struct _rom_header *}
In file included from main/rom_gc.c:38:
main/ROM-Cache.h:36:24: note: expected 'u8 *' {aka 'unsigned char *'} but argument is of type 'rom_header *' {aka 'struct _rom_header *'}
   36 | void ROMCache_read(u8* ram_dest, u32 rom_offset, u32 length);
      |                    ~~~~^~~~~~~~
make: *** [<builtin>: main/rom_gc.o] Error 1
@superbeelavaman superbeelavaman changed the title Compile failure: incompatible pointer type Compile Errors Feb 5, 2025
@superbeelavaman
Copy link
Author

if I tell the compiler to ignore incompatible-pointer-types errors, it proceeds further, but fails here:

$ make -f Makefile.Rice_wii
powerpc-eabi-gcc -DRICE_GFX -DWII -DHW_RVL -DUSE_EXPANSION -D__wii__ -g -O3  -Wall -Wno-parentheses -Wno-unused-parameter -pipe -mcpu=750 -meabi -mhard-float  -I/opt/devkitpro/libogc2/include -I/opt/devkitpro/portlibs/ppc/include -DGEKKO -D__GX__ -DUSE_GUI -DRELEASE -DMENU_V2 -DTHREADED_AUDIO -DUSE_RECOMP_CACHE -DPPC_DYNAREC -DFASTMEM -DNO_ASM   -Wno-error=incompatible-pointer-types  -fgnu89-inline -Wno-multichar   -c -o fileBrowser/fileBrowser-libfat.o fileBrowser/fileBrowser-libfat.c
fileBrowser/fileBrowser-libfat.c: In function 'removalCallback':
fileBrowser/fileBrowser-libfat.c:143:13: error: too few arguments to function 'frontsd->isInserted'
  143 |         if(!frontsd->isInserted()) {
      |             ^~~~~~~
fileBrowser/fileBrowser-libfat.c:150:11: error: too few arguments to function 'usb->isInserted'
  150 |       if(!usb->isInserted()) {
      |           ^~~
fileBrowser/fileBrowser-libfat.c: In function 'fileBrowser_libfat_readDir':
fileBrowser/fileBrowser-libfat.c:217:38: error: implicit declaration of function 'strcasestr'; did you mean 'strcasecmp'? [-Wimplicit-function-declaration]
  217 |                                 if(!(strcasestr(direntry->name,".v64") || strcasestr(direntry->name,".z64") ||
      |                                      ^~~~~~~~~~
      |                                      strcasecmp
fileBrowser/fileBrowser-libfat.c: In function 'fileBrowser_libfat_init':
fileBrowser/fileBrowser-libfat.c:290:41: error: too few arguments to function 'frontsd->shutdown'
  290 |                                         frontsd->shutdown();
      |                                         ^~~~~~~
fileBrowser/fileBrowser-libfat.c:293:50: warning: passing argument 2 of 'fatMountSimple' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  293 |                         if(fatMountSimple ("sd", frontsd)) {
      |                                                  ^~~~~~~
In file included from fileBrowser/fileBrowser-libfat.c:26:
/opt/devkitpro/libogc2/include/fat.h:27:55: note: expected 'DISC_INTERFACE *' {aka 'struct DISC_INTERFACE_STRUCT *'} but argument is of type 'const DISC_INTERFACE *' {aka 'const struct DISC_INTERFACE_STRUCT *'}
   27 | bool fatMountSimple(const char* name, DISC_INTERFACE* iface);
      |                                       ~~~~~~~~~~~~~~~~^~~~~
fileBrowser/fileBrowser-libfat.c:297:63: warning: passing argument 2 of 'fatMountSimple' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  297 |                         else if(!res && fatMountSimple ("sd", carda)) {
      |                                                               ^~~~~
/opt/devkitpro/libogc2/include/fat.h:27:55: note: expected 'DISC_INTERFACE *' {aka 'struct DISC_INTERFACE_STRUCT *'} but argument is of type 'const DISC_INTERFACE *' {aka 'const struct DISC_INTERFACE_STRUCT *'}
   27 | bool fatMountSimple(const char* name, DISC_INTERFACE* iface);
      |                                       ~~~~~~~~~~~~~~~~^~~~~
fileBrowser/fileBrowser-libfat.c:301:63: warning: passing argument 2 of 'fatMountSimple' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  301 |                         else if(!res && fatMountSimple ("sd", cardb)) {
      |                                                               ^~~~~
/opt/devkitpro/libogc2/include/fat.h:27:55: note: expected 'DISC_INTERFACE *' {aka 'struct DISC_INTERFACE_STRUCT *'} but argument is of type 'const DISC_INTERFACE *' {aka 'const struct DISC_INTERFACE_STRUCT *'}
   27 | bool fatMountSimple(const char* name, DISC_INTERFACE* iface);
      |                                       ~~~~~~~~~~~~~~~~^~~~~
fileBrowser/fileBrowser-libfat.c:314:33: error: too few arguments to function 'usb->shutdown'
  314 |                                 usb->shutdown();
      |                                 ^~~
fileBrowser/fileBrowser-libfat.c:317:51: warning: passing argument 2 of 'fatMountSimple' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  317 |                         if(fatMountSimple ("usb", usb)) {
      |                                                   ^~~
/opt/devkitpro/libogc2/include/fat.h:27:55: note: expected 'DISC_INTERFACE *' {aka 'struct DISC_INTERFACE_STRUCT *'} but argument is of type 'const DISC_INTERFACE *' {aka 'const struct DISC_INTERFACE_STRUCT *'}
   27 | bool fatMountSimple(const char* name, DISC_INTERFACE* iface);
      |                                       ~~~~~~~~~~~~~~~~^~~~~
make: *** [<builtin>: fileBrowser/fileBrowser-libfat.o] Error 1

@Extrems
Copy link
Collaborator

Extrems commented Feb 5, 2025

It's been a few years since this project was touched, and the underlying SDK can be a fast moving target.

@superbeelavaman
Copy link
Author

superbeelavaman commented Feb 6, 2025

I was able to get a successful build by changing the following:

in Makefile.base, add "-Wno-error=incompatible-pointer-types" to CXXFLAGS
in fileBrowser-libfat.c,
change strcasestr( to strstr(
change frontsd->isInserted() to frontsd->isInserted(0)
change usb->isInserted() to usb->isInserted(0)
change frontsd->shutdown() to frontsd->shutdown(0)
change usb->shutdown() to usb->shutdown(0)

I can tell this was definitely not the correct solution, as SD and USB are now completely non-functional but as a temporary workaround it should be fine for my testing as long as dvd still works.
When loaded in Dolphin, it warns about an invalid read from 0x00000000 when attempting to read the sd card, but not for usb.
I don't know a whole lot about this yet but I think it's probably expecting a pointer to where the SD card or USB is rather than 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants