After compiling ScummVM with the MT-32 emulator disabled, ld fails
to link with the following errors under GCC 4.0:
/usr/bin/ld: Undefined symbols:
MidiDriver_MPU401::allocateChannel()
MidiDriver_MPU401::setTimerCallback(void*, void (*)(void*))
MidiDriver_MPU401::close()
MidiDriver_MPU401::property(int, unsigned int)
MidiDriver_MPU401::MidiDriver_MPU401()
typeinfo for MidiDriver_MPU401
vtable for MidiDriver_MPU401
collect2: ld returned 1 exit status
make: *** [scummvm] Error 1
GCC 3.3 gives these errors instead:
ld: Undefined symbols:
__ZN17MidiDriver_MPU40115allocateChannelEv
__ZN17MidiDriver_MPU40116setTimerCallbackEPvPFvS0_E
__ZN17MidiDriver_MPU4015closeEv
__ZN17MidiDriver_MPU4018propertyEij
__ZN17MidiDriver_MPU401C2Ev
__ZTV17MidiDriver_MPU401
make: *** [scummvm] Error 1
I've tested with both GCC 3.3 and 4.0 under Mac OS X 10.4.2 with
an up-to-date CVS.
Logged In: YES
user_id=166507
Weird, since same Makefiles are used accross many platforms
and it compiles here ok. May you attach (a) configure output
refirected to a file (b) config.h (c) config.mak
Logged In: YES
user_id=577918
For whatever it's worth, I got some similar error when
trying to compile a very minimal ScummVM under MinGW. The
GCC version is listed as "3.4.2 (mingw-special)".
Re-enabling the MT-32 emulator allowed me to compile it again.
(That was with a month-old CVS snapshot, though: I'm
currently trying to find out when a SAGA graphics glitch
first appeared, so I disabled just about everything I could,
except the SAGA engine.)
Logged In: YES
user_id=991728
I could take a look at this, but only with GCC 3.X on OS X
10.3.9,
but I think the link order is wrong. I will tell if I got it
to work.
Logged In: YES
user_id=991728
It is a problem with the linking, since if you put the
libsound.a after the libbackends.a there are only undefined
symbols to the functions in libbackends.a
(MidiDriver_NULL_Create() and so on), but I have no real
idea how to fix it.
Logged In: YES
user_id=991728
btw. I also tried to add "virtual ~MidiDriver_MPU401() { }"
to the MidiDriver_MPU401 class and the same for the classes
in the backends/midi dir, but no success, sry forget to tell it.
Logged In: YES
user_id=12935
The linker on OS X behaves differently than the linker on
e.g. Linux (GNU ld), so to an extent it's normal that things
behave differently between the two.
Lordhoto, the link order as such is not "wrong". You are not
seeing the other errors after your change simply because the
linker fails before even "seeing" the linker errors reported
in this post.
Adding "virtual" keywords won't help either, as this is
totally unrelated to the issue at hand. It really doesn't
help to try random fixes, it's much better to read up "man
ld" etc. in order to properly *understand* what's going on
:-).
Logged In: YES
user_id=12935
FYI, I can't reproduce the problem with latest CVS, under OS X 10.4.4 with GCC
3.3 and 4.0.1.
To be precise, I did a HEAD checkout, run
./configure --disable-mt32emu && make
and that worked.