User forums > Help

undefined reference to '__mulhi3' In function 'vfprintf': and 'calloc'

<< < (5/9) > >>

Ralphxyz:
I am running:

 GNU Make 3.81

and I do not believe I am running the same compiler from the command line as I do in Code::Blocks

From the command line I am running:

gcc version 4.3.3 (WinAVR 20100110)

The Code:Blocks is running something from WinAVR-20090313

I do not know how to see the version in Code::Blocks.

Ralph

Jenna:
So look at your makefile where the compiler is installed and make sure the avr toolchain im C::B uses the same compiler.

Ralphxyz:

--- Quote ---So look at your makefile where the compiler is installed and make sure the avr toolchain im C::B uses the same compiler.
--- End quote ---

I have gone completely through the Code:Blocks Toolchain pointing to the C:\WinAVR-20100110 folder instead of the default C:\WinAVR-20090313 folder but still get the same errors looking in the WinAVR-20090313 folder.

The WinAVR-20090313 is persistent, in fact there is lots of persistents in the Code::Blocks install if you uninstall and reinstall it still remembers your prior projects, I even went through regedit removing all references to CodeBlocks and a new install still knew about prior projects.

So finally I Googled "undefined reference to `__mulhi3'" and see that there has been a lot discussion on fixing this problem.

One of the most common fixes was to use the -lm flag but how? I do not see anywhere to set the flags.

Now if I was building Code::Blocks from the source files I'd understand this error but seeing as I am just trying to run a default install I just do not understand why I am getting this Compiler Linking error, if that is what it is.

Thanks so much for all of the help.

I will try changing the command line compiler, if I knew how would help.

Ralph

Ralphxyz:
 :D Solution

I renamed the C:\WinAVR-20090313 folder to zWinAVR-20090313.

Then I ran the Code::Blocks Compiler/Toolchain executables Auto-detect.

Now it found C:\WinAVR-20100110 and instantiated it.

TaDah, it works!!

Here is the Build Log:


-------------- Build: Debug in StepperJoy (compiler: GNU AVR GCC Compiler)---------------

avr-g++.exe -LC:\WinAVR-20090313\avr\lib  -o bin\Debug\StepperJoy.elf obj\Debug\fuse.o obj\Debug\main.o   -mmcu=atmega328p -Wl,-Map=bin\Debug\StepperJoy.map,--cref  C:\NERDKITS\Code\libnerdkits-328p\delay.c C:\NERDKITS\Code\libnerdkits-328p\delay.h C:\NERDKITS\Code\libnerdkits-328p\delay.o C:\NERDKITS\Code\libnerdkits-328p\io_328p.h C:\NERDKITS\Code\libnerdkits-328p\lcd.c C:\NERDKITS\Code\libnerdkits-328p\lcd.h C:\NERDKITS\Code\libnerdkits-328p\lcd.o C:\NERDKITS\Code\libnerdkits-328p\uart.c C:\NERDKITS\Code\libnerdkits-328p\uart.h C:\NERDKITS\Code\libnerdkits-328p\uart.o
Output size is 48.66 KB
Running project post-build steps
avr-size --mcu=atmega328p --format=avr bin\Debug\StepperJoy.elf
AVR Memory Usage
----------------
Device: atmega328p
Program:    9538 bytes (29.1% Full)
(.text + .data + .bootloader)
Data:        299 bytes (14.6% Full)
(.data + .bss + .noinit)
cmd /c "avr-objdump -h -S bin\Debug\StepperJoy.elf > bin\Debug\StepperJoy.lss"
avr-objcopy -R .eeprom -R .fuse -R .lock -R .signature -O ihex bin\Debug\StepperJoy.elf bin\Debug\StepperJoy.hex
avr-objcopy --no-change-warnings -j .eeprom --change-section-lma .eeprom=0 -O ihex bin\Debug\StepperJoy.elf bin\Debug\StepperJoy.eep
avr-objcopy --no-change-warnings -j .lock --change-section-lma .lock=0 -O ihex bin\Debug\StepperJoy.elf bin\Debug\StepperJoy.lock
avr-objcopy --no-change-warnings -j .signature --change-section-lma .signature=0 -O ihex bin\Debug\StepperJoy.elf bin\Debug\StepperJoy.sig
avr-objcopy --no-change-warnings -j .fuse --change-section-lma .fuse=0 -O ihex bin\Debug\StepperJoy.elf bin\Debug\StepperJoy.fuse
srec_cat bin\Debug\StepperJoy.fuse -Intel -crop 0x00 0x01 -offset  0x00 -O bin\Debug\StepperJoy.lfs -Intel
srec_cat bin\Debug\StepperJoy.fuse -Intel -crop 0x01 0x02 -offset -0x01 -O bin\Debug\StepperJoy.hfs -Intel
srec_cat bin\Debug\StepperJoy.fuse -Intel -crop 0x02 0x03 -offset -0x02 -O bin\Debug\StepperJoy.efs -Intel
Process terminated with status 0 (0 minutes, 2 seconds)
0 errors, 0 warnings (0 minutes, 2 seconds)
 
Strange no "unused -i" warnings but maybe that is covered in the compile.

Now to move on to my next question!!

Thanks again for the help.

Ralph

LETARTARE:
hello,
what is :

--- Code: ----LC:\WinAVR-20090313\avr\lib
--- End code ---
since this directory does not exist ?
Cordially.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version