Opened 14 years ago

Closed 14 years ago

Last modified 12 months ago

#2210 closed defect (worksforme)

MAC: ScummVM does not compile on Mac with MT-32 emu disabled

Reported by: SF/fancia Owned by: fingolfin
Priority: normal Component: Port: Mac OS X
Keywords: Cc:


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::setTimerCallback(void*, void (*)(void*))
MidiDriver_MPU401::property(int, unsigned int)
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:
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.

Ticket imported from: #1298180. Ticket imported from: bugs/2210.

Change History (12)

comment:1 by sev-, 14 years ago

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

comment:2 by eriktorbjorn, 14 years ago

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.)

comment:3 by lordhoto, 14 years ago

I could take a look at this, but only with GCC 3.X on OS X
but I think the link order is wrong. I will tell if I got it
to work.

comment:4 by sev-, 14 years ago

Owner: set to lordhoto

comment:5 by lordhoto, 14 years ago

Owner: lordhoto removed

comment:6 by lordhoto, 14 years ago

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.

comment:7 by lordhoto, 14 years ago

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.

comment:8 by fingolfin, 14 years ago

Owner: set to fingolfin
Summary: ALL: ScummVM does not compile on Mac with MT-32 emu disabledMAC: ScummVM does not compile on Mac with MT-32 emu disabled

comment:9 by fingolfin, 14 years ago

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

comment:10 by fingolfin, 14 years ago

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.

comment:11 by fingolfin, 14 years ago

Resolution: worksforme
Status: newclosed

comment:12 by digitall, 12 months ago

Component: Port: Mac OS X
Note: See TracTickets for help on using tickets.