Opened 13 years ago

Closed 13 years ago

Last modified 9 months 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
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 Changed 13 years ago by sev-

Owner: set to fingolfin

comment:2 Changed 13 years ago by sev-

Another victim of b0rked ld.

comment:3 Changed 13 years ago by Kirben

Priority: normalblocker

comment:4 Changed 13 years ago by eriktorbjorn

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

comment:5 Changed 13 years ago by Kirben

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 Changed 13 years ago by fingolfin

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

comment:7 Changed 13 years ago by fingolfin

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 Changed 13 years ago by cyxx

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 Changed 13 years ago by Kirben

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

I'm using GCC 3.4.5 under mingw.

comment:10 Changed 13 years ago by SF/bellut

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 Changed 13 years ago by fingolfin

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

comment:12 Changed 13 years ago by SF/bellut

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

comment:13 Changed 13 years ago by fingolfin

Resolution: fixed
Status: newclosed

comment:14 Changed 9 months ago by digitall

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