[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] Gcc 4.4.3 Linking problems, libmath testcase attached...



I created a small test for this, currently I'm linking with Vincents
cygwin port, yesterday I was compiling with the native gcc-4.4.3. So please
consider that...

My test:
#include <stdio.h>
#include <math.h>

int main()
{
	float f;
	double d;
	int i;
	printf("test%d: %d\n", 1, ceilf(f));
	printf("test%d: %d\n", 2, ceilf(d));
	printf("test%d: %d\n", 3, ceilf(i));
}


Cygwin Output:
$ m68k-atari-mint-gcc.exe testm.c -o testm.prg -lm --std=c99
testm.c: In function 'main':
testm.c:9:2: warning: implicit declaration of function 'ceilf'
testm.c:9:28: warning: incompatible implicit declaration of built-in
function 'c
eilf'
/tmp/cciSQb71.o:/tmp/cciSQb71.o:(.text+0x1c): undefined reference to
`_ceilf'
/tmp/cciSQb71.o:/tmp/cciSQb71.o:(.text+0x58): undefined reference to
`_ceilf'
/tmp/cciSQb71.o:/tmp/cciSQb71.o:(.text+0x90): undefined reference to
`_ceilf'
collect2: ld returned 1 exit status

What Is going wrong here? 

This workaround seems to work: 
#define ceilf(x) ceil(x)

greets,
ole

Am Mittwoch, den 26.05.2010, 01:06 +0200 schrieb "Ole Loots"
<ole@monochrom.net>:
> Am Mi, 26.05.2010, 00:50 schrieb Ole Loots:
> 
>> Am Mi, 26.05.2010, 00:40 schrieb Miro Kropacek:
>>>> /d/root/netsurf/netsurf/render/html_redraw.c:1877: undefined
reference
>>>> to
>>>> `_ceilf'
>>> [..]
>>>> undefined reference to `_log10'
>>> [..]
>>>>
/d/usr/bin/../lib/gcc/m68k-atari-mint/4.4.3/../../../libxml2.a(xpath.o)(.text+0x85d4):
>>>> undefined reference to `_pow'
>>
> 
> I passed /usr/lib/libm.a directly to the cc invoke ( cc foobar.o
> /usr/lib/libm.a) and then it (ld) only throws errors on _ceilf...