libretro / dosbox-libretro

Port of DOSBox (upstream) to the libretro API.
GNU General Public License v2.0
61 stars 40 forks source link

invalid use of incomplete type 'struct retro_midi_interface' #103

Open candrews opened 5 years ago

candrews commented 5 years ago

Trying to compile current master (2d6bfbfe9ae82be17afbadf41f24950c2f9e2db9), I'm getting this error:

src/midi/midi.cpp:120:23:error: invalid use of incomplete type ‘struct retro_midi_interface’
   retro_midi_interface->write(data, (uint32_t)delta_time);
# gcc --version
gcc (Gentoo 8.2.0-r2 p1.2) 8.2.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Negatifff commented 5 years ago

Good day Have same error:

libretro/libretro.cpp: In function ‘void retro_init()’:
libretro/libretro.cpp:671:40: error: aggregate ‘retro_midi_interface midi_interface’ has incomplete type and cannot be defined
     static struct retro_midi_interface midi_interface;
                                        ^~~~~~~~~~~~~~
libretro/libretro.cpp: In function ‘void retro_run()’:
libretro/libretro.cpp:806:53: error: invalid use of incomplete type ‘struct retro_midi_interface’
     if (retro_midi_interface && retro_midi_interface->output_enabled())
                                                     ^~
libretro/libretro.cpp:94:15: note: forward declaration of ‘struct retro_midi_interface’
 extern struct retro_midi_interface *retro_midi_interface;
               ^~~~~~~~~~~~~~~~~~~~
libretro/libretro.cpp:807:29: error: invalid use of incomplete type ‘struct retro_midi_interface’
         retro_midi_interface->flush();
                             ^~
libretro/libretro.cpp:94:15: note: forward declaration of ‘struct retro_midi_interface’
 extern struct retro_midi_interface *retro_midi_interface;
               ^~~~~~~~~~~~~~~~~~~~
Makefile.libretro:189: recipe for target 'libretro/libretro.o' failed
make: *** [libretro/libretro.o] Error 1
make: *** Waiting for unfinished jobs....
/home/pi
Could not successfully build lr-dosbox - DOS emulator (/home/pi/RetroPie-Setup/tmp/build/lr-dosbox/dosbox_libretro.so not found).
gcc --version
gcc (Raspbian 6.3.0-18+rpi1+deb9u1) 6.3.0 20170516
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
SuperFromND commented 5 years ago

It appears that this is because of a PR that I made that removed one of the two struct definitions for retro_midi_interface. Turns out that the commit right after removes the other struct definition.

I'll add back the one that I removed in my commit and see if that fixes anything. :+1:

Addendum: Well, if the commit below this message is any indication, it didn't work out well. I wasn't 100% sure on whether or not the struct I added was the "correct" one, so I closed the commit. Paging @twinaphex for input on which struct defintion should be kept and which should be removed.

Negatifff commented 5 years ago

Hello. Duplicate the post, if you have not seen - https://github.com/libretro/dosbox-libretro/pull/104#issuecomment-421413955

kimjj93 commented 5 years ago

Any update on this yet?