Author Topic: Error on Startup  (Read 7687 times)

Offline Supercap2F

  • Single posting newcomer
  • *
  • Posts: 6
Error on Startup
« on: July 30, 2014, 02:39:06 pm »
Hello Everyone! Hope I'm in the right place.  ;D

To introduce myself, I'm 14 and have a deep interest in electronics/circuit design. I needed to learn the syntax of C so I could program microcontrollers. So I picked up a copy of C for dummies and they said to get Code::Blocks. Tell me if I'm wrong but I think what you can do with Code::Blocks is you can:

1) Wirte your program in it
2) Compile and link you program
3) Run your program.

OK, now the problem is that when I startup Code::Blocks I get this message on the bottom of the screen:
"Can't find compiler executable in your configured search path's for Microsoft Visual C ++ Toolkit 2003"
Did I install it wrong? Is there something I can do to fix it? If so then what?

Thanks for all your time! :)


I never met a biscuit I didn't like.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Error on Startup
« Reply #1 on: July 30, 2014, 11:24:40 pm »
Code::Blocks is you can:

1) Wirte your program in it
2) Compile and link you program
3) Run your program.
not completely true. You can compile and link your program with the help of c::b, but c::b can't do this from his own. c::b needs a compiler and liker to compile/link your source files.
So when you install c::b "normally" you don't install a compiler. You have to choose and install it yourself. (i wrote normally, because there exists a bundle installer with c::b and tdm mingw gcc)

Your error is a indication that you don't have a compiler installed.
So the solution is easy: install a compiler, or if you have already installed a compiler, fix the paths in the settings (settings->compiler->toolchain executables)

You don't provide any information about your OS, or what compiler you want to use, so i can't help you any future...

you can find a lot help here: http://wiki.codeblocks.org/index.php?title=FAQ
[Edit:] and here: http://wiki.codeblocks.org/index.php?title=Installing_a_supported_compiler

greetings
« Last Edit: July 30, 2014, 11:26:53 pm by BlueHazzard »

Offline pirx67

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: Error on Startup
« Reply #2 on: July 30, 2014, 11:35:56 pm »
Hi,

at first it would be very helpful if you told us what version of Code::Blocks you did download and install.

I assume that you're running under Windows because Code::Blocks's output suggests being on Windows.

A web search revealed the C-for-dumies web site @ http://c-for-dummies.com/caio/compilers.php
where the author refers to this Code::Blocks download page http://www.codeblocks.org/downloads/26.

Assuming you followed these links: Which release did you download?
  • codeblocks-13.12-setup.exe: The plain Code::Blocks without any compiler
  • codeblocks-13.12mingw-setup.exe: A Code::Blocks release with a MinGW Compiler bundled
  • codeblocks-13.12mingw-setup-TDM-GCC-481.exe: A Code::Blocks release with a bleeding edge MinGW

You have to understand that Code::Blocks itself is not a compiler and not able to generate an executable program.
It is "only" a fancy GUI for the compiler with a nice editor that has some knowledge of the C syntax and many
other features that make the developer's life easier.

Knowing that you need to install a suitable compiler for your target system at first. This could be one of the
Microsoft Compilers or MinGW (a GCC variant for Windows) for example. Then you point Code::Blocks to the installation path
of the compiler and it will use it.

To make that process easier the codeblocks-13.12mingw-setup.exe installer provides a bundle of Code::Blocks and MinGW for Windows.

For details on the installation refer to the following wiki pages http://wiki.codeblocks.org/index.php?title=Installing_the_latest_official_version_of_Code::Blocks_on_Windows and http://wiki.codeblocks.org/index.php?title=Installing_a_supported_compiler.
The latest official release is atm. 13.12.

Note:
You mentioned that you want to program microcontrollers. Depending on the type of microcontroller you need a compiler that fits to the
used microcontroller (like AVR-GCC for AVR microcontrollers). The before mentioned compilers will generate code that can only be run
under Windows!

I hope that points you in the right direction.

Regards,
    pirx67

PS.: At the moment I saw that BlueHazzard has answered your questions already but I don't like to discard this post now and
submit it anyway.

Offline Supercap2F

  • Single posting newcomer
  • *
  • Posts: 6
Re: Error on Startup
« Reply #3 on: July 31, 2014, 03:04:59 pm »
WOW, lots of good info here! Thanks Guys!

Quote from: BlueHassard
not completely true. You can compile and link your program with the help of c::b, but c::b can't do this from his own. c::b needs a compiler and liker to compile/link your source files.

OK, that makes since. I might have some more questions on this later though.

Quote
So when you install c::b "normally" you don't install a compiler. You have to choose and install it yourself. (i wrote normally, because there exists a bundle installer with c::b and tdm mingw gcc)
Quote from: pirx67
A web search revealed the C-for-dumies web site @ http://c-for-dummies.com/caio/compilers.php
where the author refers to this Code::Blocks download page http://www.codeblocks.org/downloads/26.

Assuming you followed these links: Which release did you download?
codeblocks-13.12-setup.exe: The plain Code::Blocks without any compiler
codeblocks-13.12mingw-setup.exe: A Code::Blocks release with a MinGW Compiler bundled
codeblocks-13.12mingw-setup-TDM-GCC-481.exe: A Code::Blocks release with a bleeding edge MinGW

Yes I followed the link, and downloaded the "codeblocks-13.12mingw-setup.exe".

Quote from: BlueHazzard
You don't provide any information about your OS, or what compiler you want to use, so i can't help you any future...

I'm using Windows 7 32 bit. I think that I want to use MinGW.

Quote from: pirx67
You have to understand that Code::Blocks itself is not a compiler and not able to generate an executable program.
It is "only" a fancy GUI for the compiler with a nice editor that has some knowledge of the C syntax and many
other features that make the developer's life easier.

Knowing that you need to install a suitable compiler for your target system at first. This could be one of the
Microsoft Compilers or MinGW (a GCC variant for Windows) for example. Then you point Code::Blocks to the installation path
of the compiler and it will use it.

OK, I think I get that too.

Quote
To make that process easier the codeblocks-13.12mingw-setup.exe installer provides a bundle of Code::Blocks and MinGW for Windows.

For details on the installation refer to the following wiki pages http://wiki.codeblocks.org/index.php?title=Installing_the_latest_official_version_of_Code::Blocks_on_Windows and http://wiki.codeblocks.org/index.php?title=Installing_a_supported_compiler.
The latest official release is atm. 13.12.

OK, I will have a look at those links.

Quote
Note:
You mentioned that you want to program microcontrollers. Depending on the type of microcontroller you need a compiler that fits to the
used microcontroller (like AVR-GCC for AVR microcontrollers). The before mentioned compilers will generate code that can only be run
under Windows!

I was going to be programing PICs with MPLAB. I just got Code::Blocks to learn C. :)

OK, so I went to Settings->Complier->Toolchain executables. Under "Compiler's installed directory" I put the path to MinGW that came with Code::Blocks. Hit OK, and I still gives me the error message. Did I do something wrong?

Thanks Guys! I can't wait to start programing in C!  ;D








I never met a biscuit I didn't like.

Offline Vuki

  • Multiple posting newcomer
  • *
  • Posts: 41
Re: Error on Startup
« Reply #4 on: July 31, 2014, 07:43:39 pm »
Change your project to use MinGW compiler, not the MS Toolkit (Project, Properties).

Offline Supercap2F

  • Single posting newcomer
  • *
  • Posts: 6
Re: Error on Startup
« Reply #5 on: July 31, 2014, 08:00:27 pm »
I tried to but it was grayed out (it wouldn't let me click on it).  :(

I never met a biscuit I didn't like.

Offline Vuki

  • Multiple posting newcomer
  • *
  • Posts: 41
Re: Error on Startup
« Reply #6 on: July 31, 2014, 08:21:52 pm »
Can you select MinGW compiler from the list on the toolbar? Did you try to compile the project? What is the output in the Compiler pane window?

Try also this: create a console project from the New Project Wizard, select MinGW compiler, try to compile the project. This will verify that your configuration is correct.

As for the error you mentioned - the one in a yellow popup. Usually you may ignore it. Some projects have targets for different compilers, e.g. Visual C++ and MinGW. If you do not have some of these compillers installed, you will get this warning. It's annoying, but you may safely ignore it if you have installed at least one compiler.

What really matters is the ouput shown in the Compiler tab after you try to compile your project.
If you still have problems, please post full compiler log (see Forum rules).

Offline Supercap2F

  • Single posting newcomer
  • *
  • Posts: 6
Re: Error on Startup
« Reply #7 on: July 31, 2014, 08:58:00 pm »
Quote
Can you select MinGW compiler from the list on the toolbar? Did you try to compile the project? What is the output in the Compiler pane window?

Toolbar ??? what toolbar? Yes I tried to compile the project.. nothing happened though.

Quote
Try also this: create a console project from the New Project Wizard, select MinGW compiler, try to compile the project. This will verify that your configuration is correct.

OK, Heres what I did: Opened Code::Blocks, Clicked 'File' -> 'New' -> 'Project'. Clicked: 'Console application' -> 'Go'. The wizard opened. I clicked 'Next' selected 'C' for the Syntax. typed in a project title, clicked 'Next'. Clicked the 'Compiler' drop down list, and MinGW was not in it. Did I do something wrong?  Can you give me step-by-step instructions on what I need to do?

Thanks so much for your time  ;D
  
« Last Edit: July 31, 2014, 09:05:18 pm by Supercap2F »
I never met a biscuit I didn't like.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Error on Startup
« Reply #8 on: July 31, 2014, 09:12:20 pm »
Try looking for "GNU GCC Compiler".
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Supercap2F

  • Single posting newcomer
  • *
  • Posts: 6
Re: Error on Startup
« Reply #9 on: July 31, 2014, 09:24:57 pm »
Quote
Try looking for "GNU GCC Compiler".

Yes that was there! I selected it and created the project. I typed in the sample code that they had in the book, and it ran the program. It seems to be working for now(the program did what it was supposed to), but if it stops or I get stuck, I will be back!

Thanks Guys! :)

I never met a biscuit I didn't like.