Can't compile under FreeBSD July 25, 2009, 12:08:03 pm Just grabbed the latest SVN and am unable to compile (note, I'm using gmake):[...]===> CXX bauer/warenbauer.ccIn file included from bauer/../simware.h:5, from bauer/warenbauer.cc:11:bauer/../dataobj/koord.h: In function 'uint32 koord_distance(const koord&, const koord&)':bauer/../dataobj/koord.h:74: error: 'abs' was not declared in this scopebauer/warenbauer.cc: In static member function 'static bool warenbauer_t::register_besch(ware_besch_t*)':bauer/warenbauer.cc:121: warning: cast from type 'const ware_besch_t* const' to type 'ware_besch_t*' casts away constnessgmake: *** [bauer/warenbauer.o] Error 1Having a look at koord.h, it seems as if the abs() calls are the problem. Maybe I'm forgetting my C++, but is it proper to define function bodies in a header file?It's been a while since I've tried to recompile this, so I'm not sure how long the problem has existed. Quote Selected
Re: Can't compile under FreeBSD Reply #1 – July 25, 2009, 08:05:06 pm aparently different distributions have their standard definitions at different places. Include math.h (probably) into koord.h should fix this. Quote Selected
Re: Can't compile under FreeBSD Reply #2 – July 26, 2009, 08:07:42 pm I have the same problem on Ubuntu 9.04 32-bit, gcc 4.3.3, including <math.h> doesn't help.After googling adding <cstdlib> resolves problem for me. Quote Selected
Re: Can't compile under FreeBSD Reply #3 – July 27, 2009, 07:44:06 am Quote from: Hanczar – on July 26, 2009, 08:07:42 pmI have the same problem on Ubuntu 9.04 32-bit, gcc 4.3.3, including <math.h> doesn't help.After googling adding <cstdlib> resolves problem for me.Did you compile without DEBUG? If you compile with DEBUG, cstdlib get's included via simtypes.h.I've observed the same and posted it in an other thread (http://forum.simutrans.com/index.php?topic=2526.0). Quote Selected