[therion] problem compiling on debian woody

Roman Muñoz tatel at infonegocio.com
Tue Jan 18 02:43:09 CET 2005


Hi again,

It worked like a charm

Many thanks,
Roman



On Tue, 18 Jan 2005 00:50:42 +0000
Olly Betts <olly at survex.com> wrote:

>> On Tue, Jan 18, 2005 at 12:45:09AM +0100, Roman Mu?oz wrote:
>
>>> > thparse.cxx:756: implicit declaration of function `int round(...)'
>>> > make: *** [thparse.o] Error 1
>
>>
>> round() was added to ISO C in the 1999 revision of the standard, which
>> can make it tricky to call from C++ currently (ISO C++ includes the C89
>> library functions, but not those added in C99 so these currently live in
>> a strange no man's land).  Actually, now I think about it, I'm not sure
>> the compiler in woody supports round() even in C code.
>>
>> Anyway, the simplest solution is probably just to stick your own
>> implementation of round near the top of any file which wants it (looks
>> like thparse.cxx is the only one actually).  Adding it just after the
>> #include lines is safest:
>>
>> static inline double
>> round(double x) {
>>     if (x >= 0.0) return floor(x + 0.5);
>>     return ceil(x - 0.5);
>> }
>>
>> Cheers,
>>     Olly





More information about the Therion mailing list