News:

Do you need help?
Simutrans Wiki Manual can help you to play and extend Simutrans. In 9 languages.

Bernd, watch out on your current branch....

Started by neroden, April 15, 2010, 03:40:15 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

neroden

The signal placement patch introduced a failure to compile with GCC 4.4 which I *can't debug*.  It dies at linker time with


gui/signal_spacing.o: In function `non-virtual thunk to signal_spacing_frame_t::action_triggered(gui_action_creator_t*, value_t)':
/home/neroden/programming/simutrans/gui/../ifc/gui_fenster.h:41: multiple definition of `non-virtual thunk to signal_spacing_frame_t::action_triggered(gui_action_creator_t*, value_t)'
gui/signal_spacing.o:/home/neroden/programming/simutrans/gui/../ifc/gui_fenster.h:41: first defined here
gui/signal_spacing.o: In function `signal_spacing_frame_t::action_triggered(gui_action_creator_t*, value_t)':
/home/neroden/programming/simutrans/gui/signal_spacing.cc:58: multiple definition of `signal_spacing_frame_t::action_triggered(gui_action_creator_t*, value_t)'
gui/signal_spacing.o:/home/neroden/programming/simutrans/gui/signal_spacing.cc:58: first defined here
gui/signal_spacing.o:(.data+0x2): multiple definition of `signal_spacing_frame_t::replace'
gui/signal_spacing.o:(.data+0x2): first defined here
gui/signal_spacing.o:(.data+0x1): multiple definition of `signal_spacing_frame_t::remove'
gui/signal_spacing.o:(.data+0x1): first defined here
gui/signal_spacing.o:(.data+0x0): multiple definition of `signal_spacing_frame_t::signal_spacing'
gui/signal_spacing.o:(.data+0x0): first defined here
gui/signal_spacing.o: In function `signal_spacing_frame_t':
/home/neroden/programming/simutrans/gui/signal_spacing.cc:19: multiple definition of `signal_spacing_frame_t::signal_spacing_frame_t(spieler_t*, wkz_roadsign_t*)'
gui/signal_spacing.o:/home/neroden/programming/simutrans/gui/signal_spacing.cc:19: first defined here
gui/signal_spacing.o: In function `signal_spacing_frame_t':
/home/neroden/programming/simutrans/gui/signal_spacing.cc:19: multiple definition of `signal_spacing_frame_t::signal_spacing_frame_t(spieler_t*, wkz_roadsign_t*)'
gui/signal_spacing.o:/home/neroden/programming/simutrans/gui/signal_spacing.cc:19: first defined here
collect2: ld returned 1 exit status
make: *** [sim] Error 1


(EDIT: No idea why.) Anyway, it's beyond my C++ expertise.

EDIT: Mods, this belongs in the experimental forum.  It's getting late.  :-(

prissi

I would say there is a virtual missing before one of the overlaid definitions. Or this is a way to warn before a virtual function call, if there is no action creator?

neroden

#2
Quote from: prissi on April 15, 2010, 10:29:59 AM
I would say there is a virtual missing before one of the overlaid definitions. Or this is a way to warn before a virtual function call, if there is no action creator?

There was a "virtual" missing before one of the two definitions of get_resizemodes, but adding it didn't fix the problem.

There's something very weird about the warning message.
gui/signal_spacing.o:(.data+0x2): multiple definition of `signal_spacing_frame_t::replace'
gui/signal_spacing.o:(.data+0x2): first defined here

Notice that both of the "multiple definitions" are in the *same location*.

That and the fact that this is a linker error rather than a compiler error.

If this were templated code I would guess it was a problem with the same template being instantiated independently in two different compilation units (files), creating separate definitions for the same class in two compilation units.  But it's not templated code.

EDIT: Maybe there's a double definition of the resizemodes enum....

jamespetts

Although the signal spacing patch is incorporated in Experimental, it was originally from a patch submitted by Dwachs for Standard, and there is an up-to-date Standard compatible patch that would, I assume, have the same issues...
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

neroden

Duplicate entry in the Makefile confused things.   :P  Fixed on my jp-devel branch.