Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#39391 closed defect (fixed)

CrimsonFields @0.5.3_1: "vtable for Path" undefined for x86_64

Reported by: mrosenstihl@… Owned by: phw@…
Priority: Normal Milestone:
Component: ports Version: 2.1.3
Keywords: haspatch Cc: nerdling (Jeremy Lavergne)
Port: CrimsonFields

Description

CrimsonFields does not compile on Mountain Lion, here is the relevant error in the logfile:

:info:build mv -f .deps/textbox.Tpo .deps/textbox.Po
:info:build /usr/bin/clang++  -pipe -O2 -arch x86_64 -I/opt/local/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE  -L/opt/local/lib -L/opt/local/lib -arch x86_64 -o crimson ai.o building.o combat.o container.o event.o game.o history.o initwindow.o main.o map.o mapwindow.o mission.o network.o options.o path.o platform.o player.o unit.o unitwindow.o SDL_zlib.o button.o extwindow.o fileio.o filewindow.o font.o gamewindow.o hexsup.o lang.o list.o listselect.o lset.o mapview.o mapwidget.o misc.o rect.o slider.o sound.o strutil.o surface.o textbox.o view.o widget.o window.o  -lz  -L/opt/local/lib -lSDLmain -Wl,-framework,AppKit -lSDL -Wl,-framework,Cocoa -lSDL_ttf -lSDL_mixer
:info:build Undefined symbols for architecture x86_64:
:info:build   "vtable for Path", referenced from:
:info:build       AI::AssignObjectives() in ai.o
:info:build       AI::UnitCanReach(Unit const*, Point const&, unsigned short) in ai.o
:info:build       AI::CommandUnitRepair(Unit*) in ai.o
:info:build       AI::UnitGoTo(Unit*, Point const&, unsigned short) in ai.o
:info:build       AI::FindBestTarget(Unit const*) in ai.o
:info:build       AI::FindBestHex(Unit const*, Unit const*) const in ai.o
:info:build       AI::FindTransport(Unit const*, Point const&, unsigned short, bool) in ai.o
:info:build       ...
:info:build   NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
:info:build ld: symbol(s) not found for architecture x86_64
:info:build clang: error: linker command failed with exit code 1 (use -v to see invocation)
:info:build make[2]: *** [crimson] Error 1
:info:build make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_games_CrimsonFields/CrimsonFields/work/crimson-0.5.3/src/cf'
:info:build make[1]: *** [all-recursive] Error 1
:info:build make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_games_CrimsonFields/CrimsonFields/work/crimson-0.5.3/src'
:info:build make: *** [all-recursive] Error 1
:info:build make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_games_CrimsonFields/CrimsonFields/work/crimson-0.5.3'
:info:build Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_games_CrimsonFields/CrimsonFields/work/crimson-0.5.3" && /usr/bin/make -j8 -w all 
:info:build Exit code: 2
:error:build org.macports.build for port CrimsonFields returned: command execution failed
:debug:build Error code: CHILDSTATUS 4052 2
:debug:build Backtrace: command execution failed
    while executing
"system -nice 0 $fullcmdstring"
    ("eval" body line 1)
    invoked from within
"eval system $notty $nice \$fullcmdstring"
    invoked from within
"command_exec build"
    (procedure "portbuild::build_main" line 8)
    invoked from within
"$procedure $targetname"
:info:build Warning: targets not executed for CrimsonFields: org.macports.activate org.macports.build org.macports.destroot org.macports.install
:notice:build Please see the log file for port CrimsonFields for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_games_CrimsonFields/CrimsonFields/main.log

Proposed fix: CrimsonFields can be compiled with the following fix to src/cf/path.cpp:

remove "inline" from Path::ETA and Path::StopSearch, see following diff:

--- path.cpp	2013-06-08 20:32:35.000000000 +0200
+++ path..cpp.orig	2013-06-08 20:32:00.000000000 +0200
@@ -212,7 +212,7 @@
 // RETURNS    : estimated cost to destination
 ////////////////////////////////////////////////////////////////////////
 
-unsigned short Path::ETA( const Point &p ) const {
+inline unsigned short Path::ETA( const Point &p ) const {
   return Distance( p, end ) * quality;
 }
 
@@ -249,7 +249,7 @@
 // RETURNS    : TRUE if search aborted, FALSE otherwise
 ////////////////////////////////////////////////////////////////////////
 
-bool Path::StopSearch( const PathNode &next ) const {
+inline bool Path::StopSearch( const PathNode &next ) const {
   return Distance( next.pos, end ) <= deviation;
 }

Change History (3)

comment:1 Changed 11 years ago by larryv (Lawrence Velázquez)

Owner: changed from macports-tickets@… to phw@…
Summary: CrimsonFields @0.5.3 build error; fix proposedCrimsonFields @0.5.3_1: "vtable for Path" undefined for x86_64

Thanks for the ticket. In the future, please Cc relevant port maintainers and attach patches instead of pasting them inline.

comment:2 Changed 11 years ago by nerdling (Jeremy Lavergne)

Cc: snc@… added
Resolution: fixed
Status: newclosed

Patched in r106957, maintainer timeout.

comment:3 Changed 11 years ago by jmroot (Joshua Root)

Are you sure that only affects 10.8? It looks like it would be a problem whenever compiling in C99 mode.

Note: See TracTickets for help on using tickets.