id,summary,reporter,owner,description,type,status,priority,component,version,resolution,keywords,cc,game 3974,ALL: Linker errors when building ScummVM,eriktorbjorn,fingolfin,"{{{#!Markdown Latest SVN snapshot I'm currently not able to compile ScummVM because of linking errors. See linker output below. It's as if the linking process never sees the base/game.o file. I tried passing the --verbose option to the linker, and part of the output read: attempt to open base/libbase.a succeeded \(base/libbase.a\)main.o \(base/libbase.a\)commandLine.o \(base/libbase.a\)plugins.o \(base/libbase.a\)version.o Note how base/game.o is missing. The manual makes vague references to the linker throwing away unnecessary object files, but I don't know what constitutes an unnecessary object file. http://www.lysium.de/blog/index.php?/archives/222-Lost-static-objects-in-static-libraries-with-GNU-linker-ld.html has some things to say about the problem, but I don't really understand it yet. I do know that if I add base/game.o manually to the build command, or surround base/libbase.a with -Wl,--whole-archive ... -Wl,--no-whole-archive it works. I did notice that the code in base/game.cpp is not in any namespace, but I don't know if that makes any difference. Linker output: engines/scumm/libscumm.a\(detection.o\): In function \`ScummMetaEngine::querySaveMetaInfos\(char const\*, int\) const': /home/d91tan/src/CVS/scummvm/engines/scumm/detection.cpp:1004: undefined reference to \`SaveStateDescriptor::setDeletableFlag\(bool\)' /home/d91tan/src/CVS/scummvm/engines/scumm/detection.cpp:1005: undefined reference to \`SaveStateDescriptor::setThumbnail\(Graphics::Surface\*\)' /home/d91tan/src/CVS/scummvm/engines/scumm/detection.cpp:1014: undefined reference to \`SaveStateDescriptor::setSaveDate\(int, int, int\)' /home/d91tan/src/CVS/scummvm/engines/scumm/detection.cpp:1019: undefined reference to \`SaveStateDescriptor::setSaveTime\(int, int\)' /home/d91tan/src/CVS/scummvm/engines/scumm/detection.cpp:1025: undefined reference to \`SaveStateDescriptor::setPlayTime\(int, int\)' engines/scumm/libscumm.a\(detection.o\): In function \`ScummMetaEngine::detectGames\(Common::FSList const&\) const': /home/d91tan/src/CVS/scummvm/engines/scumm/detection.cpp:720: undefined reference to \`findPlainGameDescriptor\(char const\*, PlainGameDescriptor const\*\)' /home/d91tan/src/CVS/scummvm/engines/scumm/detection.cpp:723: undefined reference to \`GameDescriptor::updateDesc\(char const\*\)' engines/kyra/libkyra.a\(detection.o\): In function \`KyraMetaEngine::querySaveMetaInfos\(char const\*, int\) const': /home/d91tan/src/CVS/scummvm/engines/kyra/detection.cpp:1209: undefined reference to \`SaveStateDescriptor::setDeletableFlag\(bool\)' /home/d91tan/src/CVS/scummvm/engines/kyra/detection.cpp:1210: undefined reference to \`SaveStateDescriptor::setThumbnail\(Graphics::Surface\*\)' engines/queen/libqueen.a\(queen.o\): In function \`QueenMetaEngine::detectGames\(Common::FSList const&\) const': /home/d91tan/src/CVS/scummvm/engines/queen/queen.cpp:119: undefined reference to \`GameDescriptor::updateDesc\(char const\*\)' /home/d91tan/src/CVS/scummvm/engines/queen/queen.cpp:121: undefined reference to \`GameDescriptor::updateDesc\(char const\*\)' /home/d91tan/src/CVS/scummvm/engines/queen/queen.cpp:123: undefined reference to \`GameDescriptor::updateDesc\(char const\*\)' /home/d91tan/src/CVS/scummvm/engines/queen/queen.cpp:125: undefined reference to \`GameDescriptor::updateDesc\(char const\*\)' engines/sky/libsky.a\(sky.o\): In function \`SkyMetaEngine::detectGames\(Common::FSList const&\) const': /home/d91tan/src/CVS/scummvm/engines/sky/sky.cpp:191: undefined reference to \`GameDescriptor::updateDesc\(char const\*\)' gui/libgui.a\(launcher.o\): In function \`GUI::SaveLoadChooser::updateSelection\(bool\)': /home/d91tan/src/CVS/scummvm/gui/launcher.cpp:678: undefined reference to \`SaveStateDescriptor::getBool\(Common::String const&\) const' common/libcommon.a\(advancedDetector.o\): In function \`Common::toGameDescriptor\(Common::ADGameDescription const&, PlainGameDescriptor const\*\)': /home/d91tan/src/CVS/scummvm/common/advancedDetector.cpp:153: undefined reference to \`GameDescriptor::updateDesc\(char const\*\)' common/libcommon.a\(advancedDetector.o\): In function \`Common::AdvancedDetector::findGameID\(char const\*, PlainGameDescriptor const\*, Common::ADObsoleteGameID const\*\)': /home/d91tan/src/CVS/scummvm/common/advancedDetector.cpp:117: undefined reference to \`findPlainGameDescriptor\(char const\*, PlainGameDescriptor const\*\)' /home/d91tan/src/CVS/scummvm/common/advancedDetector.cpp:127: undefined reference to \`findPlainGameDescriptor\(char const\*, PlainGameDescriptor const\*\)' collect2: ld returned 1 exit status make: \*\*\* \[scummvm\] Error 1 }}} {{{#!div style=""font-size: 75%"" Ticket imported from: !#2114739. Ticket imported from: bugs/3974. }}}",defect,closed,normal,Port: Linux,,fixed,,,