Author Topic: undefined reference to '__mulhi3' In function 'vfprintf': and 'calloc'  (Read 26771 times)

Offline Ralphxyz

  • Multiple posting newcomer
  • *
  • Posts: 18
 :( I really do not know where even to begin.

I am a new user of Code:Blocks.

So far I have had a time getting my #includes "..." to work, but I have them working now.

But what about these errors:



This is using the C:\WinAVR-20090313 compiler.

Using the Atmel Toolchain I am able to build and compile my code without problems but that is using a different version of the AVR-GCC compiler.

How would I point Code:Blocks to the newer AVR-GCC compiler? Actually I cannot find the Atmel AVR Toolchain there is this notation in my Path C:\Program Files (x86)\Atmel\AVR Tools\AVR Toolchain\bin but that does not work for the Compiler's installation directory in Code:Blocks so I have to fix these undefined references problem.

Thanks for the help,
Ralph

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12246
    • Travis build status
Re: undefined reference to '__mulhi3' In function 'vfprintf': and 'calloc'
« Reply #1 on: January 25, 2013, 10:10:17 am »
Have you tried setting up a compiler in Settings -> Compiler?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6789
    • My Best Post
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Ralphxyz

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: undefined reference to '__mulhi3' In function 'vfprintf': and 'calloc'
« Reply #3 on: January 25, 2013, 06:45:08 pm »
Quote
Have you tried setting up a compiler in Settings -> Compiler?

Short answer "yes" now what?

I think that answers both of my replies, thank you.

The default installed AVR-GCC compiler gets these "undefined reference" errors pointing to the compiler libraries
nothing that I have control over.

Ralph


Offline stahta01

  • Lives here!
  • ****
  • Posts: 6789
    • My Best Post
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Ralphxyz

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: undefined reference to '__mulhi3' In function 'vfprintf': and 'calloc'
« Reply #5 on: January 25, 2013, 09:29:35 pm »
Now this is just a default installation of Code:Blocks.

The problem is with the installation of Code:Blocks.

I guess my first thing to do would be to re-install code blocks.

I take it this is not a common error.

Ralph

Offline Ralphxyz

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: undefined reference to '__mulhi3' In function 'vfprintf': and 'calloc'
« Reply #6 on: January 25, 2013, 09:49:48 pm »
I re downloaded Code:Blocks and re-installed!!

I am still getting the same undefined reference to '__mulhi3' .



Now this isn't just a undefined reference to one of my libraries this is a compiler library!!

There definitely is a problem with the Windows 8 x64 install.

Ralph

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6789
    • My Best Post
Re: undefined reference to '__mulhi3' In function 'vfprintf': and 'calloc'
« Reply #7 on: January 25, 2013, 11:03:52 pm »
FYI: I am 99.99 % sure the problem is a Compiler or CB Toolchain configuration issue.

http://wiki.codeblocks.org/index.php?title=Installing_a_supported_compiler#Compiler-neutral_setup_steps

Feel free to keep re-installing Code::Blocks; it won't fix this problem.

You do not seen wish my help, so goodbye.

Tim S.
« Last Edit: January 25, 2013, 11:06:30 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12246
    • Travis build status
Re: undefined reference to '__mulhi3' In function 'vfprintf': and 'calloc'
« Reply #8 on: January 25, 2013, 11:05:24 pm »
Have you tried to build from the command line? Does it work there?

Posting screen shots of the result is useless. Look at the "Build log" for clues.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Ralphxyz

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: undefined reference to '__mulhi3' In function 'vfprintf': and 'calloc'
« Reply #9 on: January 25, 2013, 11:44:45 pm »
Quote
If you installed the compiler on its default installation directory, there is nothing more to configure. Launch Code::Blocks and you 're all set :)
no I am not!!

I appreciate all of your help and I am trying to apply your help.

How do you run the Code:Blocks compiler from the command line.

I run fine from the command line but that is using a different compiler gcc version 4.3.2 (WinAVR 20090313).

Where is the build log? Like I said I am brand new to Code:Blocks.

Ralph

« Last Edit: January 25, 2013, 11:47:17 pm by Ralphxyz »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12246
    • Travis build status
Re: undefined reference to '__mulhi3' In function 'vfprintf': and 'calloc'
« Reply #10 on: January 25, 2013, 11:52:35 pm »
How do you run the Code:Blocks compiler from the command line.
http://wiki.codeblocks.org/index.php?title=FAQ-General#Q:_What_Code::Blocks_is_not.3F

Have you setup C::B to use the correct compiler?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline danselmi

  • Developer
  • Almost regular
  • *****
  • Posts: 202
Re: undefined reference to '__mulhi3' In function 'vfprintf': and 'calloc'
« Reply #11 on: January 26, 2013, 01:17:15 pm »
Can you post the full buildlog? Mmcu must be defined the same for compile and link phase.

Offline Ralphxyz

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: undefined reference to '__mulhi3' In function 'vfprintf': and 'calloc'
« Reply #12 on: January 26, 2013, 06:42:15 pm »
Quote
Have you setup C::B to use the correct compiler?

I have not setup anything!! I just did a install. Actually I have hit the Auto-detect button a couple of times:


Quote
Can you post the full buildlog? Mmcu must be defined the same for compile and link phase.

Again where is the build log?

Thanks for the help.

Are others running Windows 8 x64?

Ralph

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: undefined reference to '__mulhi3' In function 'vfprintf': and 'calloc'
« Reply #13 on: January 26, 2013, 06:52:31 pm »
Again where is the build log?

Are you kidding ?
You have posted a screen shot, that shows a tab, that is named "Build log".
It might help to click on the tab, even if there are other ways to reach it.

Offline Ralphxyz

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: undefined reference to '__mulhi3' In function 'vfprintf': and 'calloc'
« Reply #14 on: January 26, 2013, 07:08:04 pm »
Sorry I was not looking at anything but the error message.

Speaking of which the screen shot I posted essentially says the same thing as the the Build Log, which I have finally seen.



Ralph

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12246
    • Travis build status
Re: undefined reference to '__mulhi3' In function 'vfprintf': and 'calloc'
« Reply #15 on: January 26, 2013, 07:35:41 pm »
BTW: Have you tried to right click in these logs? There is the handy option to copy the contents as text. :)

Also when posting the full build log, use the rebuild command :)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Ralphxyz

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: undefined reference to '__mulhi3' In function 'vfprintf': and 'calloc'
« Reply #16 on: January 26, 2013, 11:26:52 pm »
It's still showing the same errors we started with!
There is a problem with the linked compiler libraries (not knowing wha tI am talking about of course).

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

Cleaned "StepperJoy - Debug"

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

avr-gcc.exe -Wall -mmcu=atmega328p -DF_CPU=14745600  -g    -IC:\WinAVR-20090313\avr\include -IC:\NERDKITS\Code\libnerdkits -IC:\WinAVR-20100110\avr\include  -c fuse.c -o obj\Debug\fuse.o
avr-gcc.exe -Wall -mmcu=atmega328p -DF_CPU=14745600  -g    -IC:\WinAVR-20090313\avr\include -IC:\NERDKITS\Code\libnerdkits -IC:\WinAVR-20100110\avr\include  -c main.c -o obj\Debug\main.o
main.c: In function 'main':
main.c:133: warning: unused variable 'i'
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
C:\WinAVR-20090313\avr\lib\libc.a(vfprintf_std.o): In function `vfprintf':
(.text+0xd4): undefined reference to `__mulhi3'
C:\WinAVR-20090313\avr\lib\libc.a(vfprintf_std.o): In function `vfprintf':
(.text+0xe4): undefined reference to `__mulhi3'
C:\WinAVR-20090313\avr\lib\libc.a(calloc.o): In function `calloc':
(.text+0x14): undefined reference to `__mulhi3'
Process terminated with status 1 (0 minutes, 0 seconds)
3 errors, 1 warnings (0 minutes, 0 seconds)
 

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12246
    • Travis build status
Re: undefined reference to '__mulhi3' In function 'vfprintf': and 'calloc'
« Reply #17 on: January 26, 2013, 11:33:08 pm »
Now, if you compare this log to the one from the command line, which works. what are the differences?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Ralphxyz

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: undefined reference to '__mulhi3' In function 'vfprintf': and 'calloc'
« Reply #18 on: January 26, 2013, 11:37:36 pm »
Quote
Now, if you compare this log to the one from the command line, which works. what are the differences?

Sorry I do not know how to get a log from the command line.

I just run "make" , that compiles my .c code following a Makefile.

There might be a option I could put in the Makefile??

Ralph

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12246
    • Travis build status
Re: undefined reference to '__mulhi3' In function 'vfprintf': and 'calloc'
« Reply #19 on: January 26, 2013, 11:40:17 pm »
It depends on the makefile, look at it and edit it. Some makefiles support VERBOSE=1.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Ralphxyz

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: undefined reference to '__mulhi3' In function 'vfprintf': and 'calloc'
« Reply #20 on: January 26, 2013, 11:57:43 pm »
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

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: undefined reference to '__mulhi3' In function 'vfprintf': and 'calloc'
« Reply #21 on: January 27, 2013, 12:05:56 am »
So look at your makefile where the compiler is installed and make sure the avr toolchain im C::B uses the same compiler.

Offline Ralphxyz

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: undefined reference to '__mulhi3' In function 'vfprintf': and 'calloc'
« Reply #22 on: January 27, 2013, 03:32:22 am »
Quote
So look at your makefile where the compiler is installed and make sure the avr toolchain im C::B uses the same compiler.

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

Offline Ralphxyz

  • Multiple posting newcomer
  • *
  • Posts: 18
 :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

Offline LETARTARE

  • Regular
  • ***
  • Posts: 395
  • L'ami de l'homme.The friend of man.
Re: undefined reference to '__mulhi3' In function 'vfprintf': and 'calloc'
« Reply #24 on: January 27, 2013, 10:32:00 am »
hello,
what is :
Code: [Select]
-LC:\WinAVR-20090313\avr\libsince this directory does not exist ?
Cordially.
C::B  : svn11911, wx-3.1.1, plugins : QtPregen-2.7.2-sdk146
1-Vista Business Pack 2 32bits : gcc-8.1.0,
2-OpenSuse-15.1-Leap 64bits :  gcc-7.4.1,
=> !! The messages are translated by Deepl !!

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: undefined reference to '__mulhi3' In function 'vfprintf': and 'calloc'
« Reply #25 on: January 27, 2013, 11:16:18 am »
hello,
what is :
Code: [Select]
-LC:\WinAVR-20090313\avr\libsince this directory does not exist ?
Cordially.
This is surely a manual setting, either in project/target settings or in the compiler toolchain.
In any case it an incorrect configuration done by the user not by C::B, and it's the cause for the OP's problem.

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.
User settings should always be persistent through install or new install.
C::B does not store anything in the registry.
The only thing there are the file associations, but that's the windows way to do it, no way to work around. And this is of course not the cause for the issue.


Offline Ralphxyz

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: undefined reference to '__mulhi3' In function 'vfprintf': and 'calloc'
« Reply #26 on: January 27, 2013, 04:21:32 pm »
Quote
what is :
Code:
-LC:\WinAVR-20090313\avr\lib
Quote
In any case it an incorrect configuration done by the user not by C::B, and it's the cause for the OP's problem.

Nope, I didn't set any configurations just hit Auto detect after moving C:\WinAVR-20090313 out of the way!!

Ralph




Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12246
    • Travis build status
Re: undefined reference to '__mulhi3' In function 'vfprintf': and 'calloc'
« Reply #27 on: January 27, 2013, 04:33:49 pm »
Then inspect your project and the compiler settings for this path and remove it.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Ralphxyz

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: undefined reference to '__mulhi3' In function 'vfprintf': and 'calloc'
« Reply #28 on: January 27, 2013, 05:58:20 pm »
Quote
Insert Quote
Then inspect your project and the compiler settings for this path and remove it.

Interesting I can not find any reference to C:\WinAVR-20090313\avr\lib but the -LC:\WinAVR-20090313\avr\lib
still shows up.

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

avr-g++.exe -LC:\WinAVR-20090313\avr\lib

In fact I no longer have a C:\WinAVR-20090313 folder on my system.

Also I do not see any place to set a -L flag.

In the Global compiler settings on the first tab there is a tab "Compiler Flags" but no -L option.

So this "-LC:\WinAVR-20090313\avr\lib" setting is not something I am doing but part of the default install.

As it is it doesn't hurt anything I am now able to Build my projects since I am using a newer (WinAVR-20100110) Toolchain.

Ralph

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12246
    • Travis build status
Re: undefined reference to '__mulhi3' In function 'vfprintf': and 'calloc'
« Reply #29 on: January 27, 2013, 06:05:05 pm »
In the Global compiler settings on the first tab there is a tab "Compiler Flags" but no -L option.
Have you tried the other tabs? What about the Search Directories -> Linker?

This starts to get really annoying.
Please make sure you've clicked on every button in the Global compiler settings and in Project -> Properties before posting your next post.
Also make sure you've read the user manual. If you don't understand it read it again.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Ralphxyz

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: undefined reference to '__mulhi3' In function 'vfprintf': and 'calloc'
« Reply #30 on: January 27, 2013, 06:18:45 pm »
Yes every tab has been inspected!

All I am trying to do is use a default install of Code::Blocks, hard to believe I am the only one to see this stuff.

Thanks for all of the help it is really appreciated.

Ralph

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: undefined reference to '__mulhi3' In function 'vfprintf': and 'calloc'
« Reply #31 on: January 27, 2013, 07:14:12 pm »
Please attach you project filke and the default.conf from $APPDATA$\codeblocks\ , so they can be inspected to find the reason for you issue.

Offline Ralphxyz

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: undefined reference to '__mulhi3' In function 'vfprintf': and 'calloc'
« Reply #32 on: January 28, 2013, 05:50:57 pm »
The default.conf is in the project folder.

Ralph

Offline Ralphxyz

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: undefined reference to '__mulhi3' In function 'vfprintf': and 'calloc'
« Reply #33 on: January 28, 2013, 06:13:18 pm »
In looking at the default.conf I see:



Should I change that to the newer Toolchain C:\WinAVR-20100110?

Where is the -L flag set?

Ralph

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: undefined reference to '__mulhi3' In function 'vfprintf': and 'calloc'
« Reply #34 on: January 28, 2013, 06:14:30 pm »
Yes every tab has been inspected!
This can not be true !
Or you have absolutely no clue of what libraries are and what a linker/compiler searchpath can be.
In this case you should read a good book/tutorial, that explains the basics of compiler/linker usage (this is not the correct website/forum for such basic stuff, sorry) and read the C::B manual.

All I am trying to do is use a default install of Code::Blocks, hard to believe I am the only one to see this stuff.
It can not be the default install, because there are several settings in the global options of the avrgcc toolchain, which are obviously wrong.

Note: neither headers (*.h), nor sources (*.c in your case) nor object files (*.o in this case) are libraries and the global linker searchdir points to the wrong compiler installation.

Offline LETARTARE

  • Regular
  • ***
  • Posts: 395
  • L'ami de l'homme.The friend of man.
Re: undefined reference to '__mulhi3' In function 'vfprintf': and 'calloc'
« Reply #35 on: January 28, 2013, 06:47:20 pm »
In looking at the default.conf I see an big error :
Code: [Select]
<LIBRARY_DIRS>
    <str>
        <![CDATA[C:\WinAVR-20090313\avr\lib;]]>
    </str>
</LIBRARY_DIRS>
also in "C::B" go
Quote
"Settings-> Global Variables -> Current variable"
choose "avr" then delete the contents of the box "lib", then exit and restart "C: B".
The wrong path should no longer appear in your "default.conf."
cordially.
C::B  : svn11911, wx-3.1.1, plugins : QtPregen-2.7.2-sdk146
1-Vista Business Pack 2 32bits : gcc-8.1.0,
2-OpenSuse-15.1-Leap 64bits :  gcc-7.4.1,
=> !! The messages are translated by Deepl !!

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: undefined reference to '__mulhi3' In function 'vfprintf': and 'calloc'
« Reply #36 on: January 28, 2013, 08:32:27 pm »
In looking at the default.conf I see an big error :
Code: [Select]
<LIBRARY_DIRS>
    <str>
        <![CDATA[C:\WinAVR-20090313\avr\lib;]]>
    </str>
</LIBRARY_DIRS>
also in "C::B" go
Quote
"Settings-> Global Variables -> Current variable"
choose "avr" then delete the contents of the box "lib", then exit and restart "C: B".
The wrong path should no longer appear in your "default.conf."
cordially.
It's a linker search path of the avr compiler and not a global variable !

Offline LETARTARE

  • Regular
  • ***
  • Posts: 395
  • L'ami de l'homme.The friend of man.
Re: undefined reference to '__mulhi3' In function 'vfprintf': and 'calloc'
« Reply #37 on: January 28, 2013, 11:27:51 pm »
I think it's time for me to go to sleep !!!!
'Jens' in quite right.
In C::B go
Quote
Settings-> Compiler-> Compiler GNU AVR GCC-> Search directories-> Linker
this time you should find the old path
Quote
C:\WinAVR-20090313\avr\lib
to remove.

Sorry for the hasty response.
C::B  : svn11911, wx-3.1.1, plugins : QtPregen-2.7.2-sdk146
1-Vista Business Pack 2 32bits : gcc-8.1.0,
2-OpenSuse-15.1-Leap 64bits :  gcc-7.4.1,
=> !! The messages are translated by Deepl !!

Offline Ralphxyz

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: undefined reference to '__mulhi3' In function 'vfprintf': and 'calloc'
« Reply #38 on: January 29, 2013, 12:06:09 am »
Oh didn't I mention that not only am I new to Code::Blocks but that I hardly know what I am doing.

I just use programs I try to know as little as possible about anything.

I just do the install and then expect to use it.

The reason I have the .c,.h,and .o files in the "Linker settings" is because otherwise they are not found from my #includes.

So this works, now tell the correct way to "include" files.

Quote
In C::B go
Quote
Settings-> Compiler-> Compiler GNU AVR GCC-> Search directories-> Linker
this time you should find the old path
Quote
C:\WinAVR-20090313\avr\lib
to remove.

Nope


Quote
Yes every tab has been inspected!
This can not be true !

But it is true true I have looked at every tab, and yes it is true that I probable could know more about things
but do I really need to just to run a default install of Code::Blocks?

I am willing to bet that something about Windows 8 x64 is helping to mess things up.

But again thank you everybody for the help.

Ralph


Offline stahta01

  • Lives here!
  • ****
  • Posts: 6789
    • My Best Post
Re: undefined reference to '__mulhi3' In function 'vfprintf': and 'calloc'
« Reply #39 on: January 29, 2013, 01:24:30 am »
The tab Compiler IS NOT that same tab as Linker.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: undefined reference to '__mulhi3' In function 'vfprintf': and 'calloc'
« Reply #40 on: January 29, 2013, 06:31:29 am »
I just use programs I try to know as little as possible about anything.
[...]
But it is true true I have looked at every tab, and yes it is true that I probable could know more about things
but do I really need to just to run a default install of Code::Blocks?

You try to do something special (embedded programming), what will (most likely) bring you much more problems, than just developping for your working system (or other pc's).

But if you state you are not willing to learn, you will never be able to do any serious programming and you are wasting the time of many other people.

I will lock this topic now and ban you for a week.
Come back if you are at least willing to find a solution yourself.