Opened 18 years ago

Closed 18 years ago

Last modified 6 years ago

#2710 closed defect (fixed)

ALL: Linker error due to link order / savefiles vtable

Reported by: SF/bellut Owned by: fingolfin
Priority: blocker Component: Port: Win32
Version: Keywords:
Cc: Game:

Description

The latest svn (23319) failes to link:

g++ backends/platform/sdl/events.o backends/platform/sdl/graphics.o backends/platform/sdl/sdl.o base/libbase.a engines/scumm/libscumm.a engines/simon/libsimon.a engines/sky/libsky.a engines/sword1/libsword1.a engines/sword2/libsword2.a engines/queen/libqueen.a engines/saga/libsaga.a engines/kyra/libkyra.a engines/gob/libgob.a engines/lure/liblure.a engines/cine/libcine.a engines/agi/libagi.a gui/libgui.a graphics/libgraphics.a sound/libsound.a common/libcommon.a backends/libbackends.a sound/softsynth/mt32/libmt32.a -lvorbisfile -lvorbis -logg -lFLAC -lmad -lasound -lz -lmpeg2 -L/usr/lib -lSDL -lpthread -o scummvm backends/libbackends.a(default-saves.o):/home/bodo/src/scummvm/svn/scummvm/backends/saves/default/default-saves.cpp:148: undefined reference to `Common::SaveFileManager::getSavePath() const' backends/libbackends.a(default-saves.o): In function `DefaultSaveFileManager::~DefaultSaveFileManager [in-charge]()': /home/bodo/src/scummvm/svn/scummvm/backends/saves/default/default-saves.cpp:146: undefined reference to `vtable for Common::SaveFileManager' backends/libbackends.a(default-saves.o): In function `DefaultSaveFileManager::~DefaultSaveFileManager [in-charge deleting]()': /home/bodo/src/scummvm/svn/scummvm/backends/saves/default/default-saves.cpp:146: undefined reference to `vtable for Common::SaveFileManager' collect2: ld returned 1 exit status make: *** [scummvm] Error 1

g++ is 3.2, there were no warnings except for 3 unused variables (2 in SAGA, 1 in Lure). configure options : --enable-lure --enable-cine --enable-agi

Ticket imported from: #1512872. Ticket imported from: bugs/2710.

Change History (14)

comment:1 by sev-, 18 years ago

Owner: set to fingolfin

comment:2 by sev-, 18 years ago

Another victim of b0rked ld.

comment:3 by Kirben, 18 years ago

Priority: normalblocker

comment:4 by eriktorbjorn, 18 years ago

Happens to me, too, unless I compile ScummVM with plugin support.

comment:5 by Kirben, 18 years ago

I'm unable to compile ScummVM SVN under mingw too, which currently doesn't offer plugin support.

Adding '-Wl,-whole-archive' at link time, doesn't help either.

comment:6 by fingolfin, 18 years ago

Summary: compile error on svn 23319ALL: Linker error due to link order / savefiles vtable

comment:7 by fingolfin, 18 years ago

Kirben: So where did you add the -Wl,-whole-archive, precisely?

Anyway, I'll implement a workaround tonight or tomorrow, depending on my available time...

comment:8 by cyxx, 18 years ago

Passing "whole-archive" to the linker works here (mingw/gcc3.4.2). I just added these 2 defines to config.mk :

PRE_OBJS_FLAGS := -Wl,--whole-archive POST_OBJS_FLAGS := -Wl,--no-whole-archive

comment:9 by Kirben, 18 years ago

Yes, that works, I must not have added it correctly.

I'm using GCC 3.4.5 under mingw.

comment:10 by SF/bellut, 18 years ago

whole-archive also works for me (Linux, g++ 3.2, ld 2.12.90.0.15), using the latest ld (2.17) however doesn't work.

comment:11 by fingolfin, 18 years ago

I commited a change to SVN which should hopefully fix the issue. Please try again and tell me whether it helps.

comment:12 by SF/bellut, 18 years ago

The change works here, ScummVM links without whole-archive.

comment:13 by fingolfin, 18 years ago

Resolution: fixed
Status: newclosed

comment:14 by digitall, 6 years ago

Component: --Unset--Port: Win32
Note: See TracTickets for help on using tickets.