avr-gcc-list
[Top][All Lists]
Advanced

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

RE: [avr-gcc-list] help in the error "undefined reference to `__mulhi3"


From: Eric Weddington
Subject: RE: [avr-gcc-list] help in the error "undefined reference to `__mulhi3"
Date: Fri, 25 May 2007 07:17:45 -0600

 

> -----Original Message-----
> From: 
> address@hidden 
> [mailto:address@hidden
> org] On Behalf Of Leonardo B. Oliveira
> Sent: Thursday, May 24, 2007 5:55 PM
> To: address@hidden
> Subject: [avr-gcc-list] help in the error "undefined 
> reference to `__mulhi3"
> 
> Hi all,
> 
> I trying to compile C code using an external library. However, it
> outputs the following. I'm using avr-gcc 3.3. Any clue?
> 
> main.o(.text+0x12): undefined reference to `__mulhi3'
> main.o(.text+0x32): undefined reference to `__mulqi3' 
> ./libmir.a(main.o): In function `muldvm':
> main.o(.text+0x6e): undefined reference to `__mulqi3'
> ./libmir.a(main.o): In function `muldvd':
> main.o(.text+0x92): undefined reference to `__mulhi3'
> ./libmir.a(main.o): In function `muldvd2':
> main.o(.text+0xb2): undefined reference to `__mulhi3'
> ./libmir.a(main.o): In function `mr_setbase':
> main.o(.text+0x494): undefined reference to `__mulqi3' 
> ./libmir.a(main.o): In function `mirvar_mem_variable':
> main.o(.text+0x612): undefined reference to `__mulhi3'
> ./libmir.a(main.o): In function `init_big_from_rom':
> main.o(.text+0x6f8): undefined reference to `pgm_read_byte_near' 
> ./libmir.a(main.o): In function `memkill':
> main.o(.text+0xc6e): undefined reference to `__mulhi3'
> ./libmir.a(main.o): In function `isqrt':
> main.o(.text+0x1262): undefined reference to `__mulhi3' 
> ./libmir.a(main.o): In function `recode':
> main.o(.text+0x135a): undefined reference to `__mulhi3'
> ./libmir.a(main.o): In function `epoint_init_mem_variable':
> main.o(.text+0x18b8): undefined reference to `__mulhi3' 
> main.o(.text+0x18d0): undefined reference to `__mulhi3'
> make: *** [exe0] Error 1

Hmm. __mulhi3 is a function found in libgcc, that comes with the toolchain.
Perhaps if you also put -lgcc on the command line after your library, that
might work.

The undefined reference to pgm_read_byte_near means that that file did not
have #include <avr/pgmspace.h>. That reference is to a macro, not a
function, and the macro is found in that header file. (Which probably means
that the library needs to be rebuilt.)

HTH
Eric





reply via email to

[Prev in Thread] Current Thread [Next in Thread]