Code::Blocks Forums
User forums => Help => Topic started by: Faber on May 11, 2018, 12:05:19 pm
-
Hello everybody, I'm new on Code::Blocks and I'm having some troubles with compiler. Code::Blocks doesn't find a right compiler so i downloaded from Internet WinAVR 20100110 . From setting -> compiler my selected compiler is GNU AVR GCC compiler (I don't have one). Into "search directories" I have two voices:
- C:\WinAVR\avr\include
- C:\WinAvr-20100110\avr\include
(this is what I've managed to add)
[/list]
In toolchain executables I didn't change anything, and in debugger fields i found: GDB/CDB debugger: avr.
Once i compile, i had this in build log:
Project/Target: "prv - Debug":
The compiler's setup (GNU GCC Compiler for AVR) is invalid, so Code::Blocks cannot find/run the compiler.
Probably the toolchain path within the compiler options is not setup correctly?!
Do you have a compiler installed?
Goto "Settings->Compiler...->Global compiler settings->GNU GCC Compiler for AVR->Toolchain executables" and fix the compiler's setup.
Tried to run compiler executable 'C:\WinAVR/bin/avr-gcc.exe', but failed!
Tried to run compiler executable 'C:\WinAVR/avr-gcc.exe', but failed!
Skipping...
Nothing to be done (all items are up-to-date).
Could someone show me the way to fix it? Thanks in advance,
Faber
-
You have to set the path to the compiler....
So if your avr-gcc is in C:\WinAVR\bin you have to set the toolchain executable*) path to C:\WinAVR\bin
*) Settings->compiler->AVR gcc from the drop down list on the top->Toolchain executables->Main path (or something like that)
-
Thank you for the reply, much appreciated ;D
I'd already did this, but I still have the same problem and print from the debugger :'(
-
Have you looked at these two messages:
Tried to run compiler executable 'C:\WinAVR/bin/avr-gcc.exe', but failed!
Tried to run compiler executable 'C:\WinAVR/avr-gcc.exe', but failed!
Do you have avg-gcc in the directory where C::B is searching for it?
-
but I still have the same problem and print from the debugger :'(
what has the debugger to do with all this?
I'd already did this,
I doubt it, because if you did it would work ;)
Ok, here is a step by step guide:
1) Download http://blog.zakkemble.co.uk/download/avr-gcc-8.1.0-x86-mingw.zip Or use this site: http://blog.zakkemble.co.uk/avr-gcc-builds/
2) Extract it to C:\AVR_GCC
3) Your compile should be at c:\AVR_GCC\bin\avr-gcc.exe
4) Open Codeblocks
5) Settings->Compiler->From the drop down list at the top select "GNU gcc compiler for AVR"
6) Toolchain executables->Compilers installation direcotry: "C:\AVR_GCC"
7) C compiler: avr-gcc.exe
c++ compiler: avr-g++.exe
linker for dynamic : avr-g++.exe
linker for static: avr-ar.exe
8) Hit ok
Create avr project:
File->New->Project->AVR-> follow the wizard
Before compiling you probably have to remove some ?unneeded? stuff from the post build steps:
1) Project->Build options->Pre/post build steps->Select the project name in the tree control on the left->Remove the "srec_cat" lines