Compiling simutrans, I got (I already commented this additional include-statement):
===> DEP gui/convoi_detail_t.cc
===> CXX gui/convoi_detail_t.cc
gui/../vehicle/../besch/vehikel_besch.h:307: Warnung: inline-Funktion »uint32 vehikel_besch_t::calc_running_cost(const karte_t*, uint32) const« verw
det, aber nirgendwo definiert
===> LD sim
gui/convoi_detail_t.o: In function `gui_vehicleinfo_t::zeichnen(koord)':
convoi_detail_t.cc:(.text+0x78d): undefined reference to `vehikel_besch_t::calc_running_cost(karte_t const*, unsigned int) const'
collect2: ld gab 1 als Ende-Status zurück
make: *** [sim] Fehler 1
Thus, I think the problem is, that this function is defined inline, but it isn't defined in the headerfile.
With this changes it compiles fine:
diff --git a/besch/vehikel_besch.h b/besch/vehikel_besch.h
index f0fb2fe..8bb81bb 100644
--- a/besch/vehikel_besch.h
+++ b/besch/vehikel_besch.h
@@ -304,7 +304,7 @@ public:
bool is_available_only_as_upgrade() const { return available_only_as_upgrade; }
// BG, 15.06.2009: the formula for obsolescence formerly implemented twice in get_betriebskosten() and get_fixed_maintenance()
- inline uint32 calc_running_cost(const karte_t *welt, uint32 base_cost) const;
+ uint32 calc_running_cost(const karte_t *welt, uint32 base_cost) const;
/**
* @return introduction year
diff --git a/gui/convoi_detail_t.cc b/gui/convoi_detail_t.cc
index 72e828f..aef4bad 100644
--- a/gui/convoi_detail_t.cc
+++ b/gui/convoi_detail_t.cc
@@ -34,7 +34,7 @@
#ifndef WIN32
// G++ seems to go wrong without this.
-#include "../besch/vehikel_besch.cc"
+// #include "../besch/vehikel_besch.cc"
#endif
Edit: I've also found a good explanation of your mistake:
http://www.parashift.com/c++-faq-lite/inline-functions.html#faq-9.6