Thread: Extra New Newbie

  1. #1
    Registered User C4Robots's Avatar
    Join Date
    Oct 2011
    Location
    Warner Robins, Georgia
    Posts
    5

    Extra New Newbie

    So I just downloaded the Code::Blocks compiler program and tried to "build" the included sample program.

    Code:
    #include <iostream>
    
    
    int main()
    {
        std::cout << "Hello world!" << std::endl;
        return 0;
    }
    I got an error message of:

    "uses an invalid compiler. Probably the toolchain path within the compiler options is not setup correctly?! "

    I tried to poke around in settings and such, but don't know what's set up wrong. Any suggestions?

  2. #2
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    Quote Originally Posted by C4Robots View Post
    Any suggestions?
    Install a Compiler.

    If you have one installed:
    What is the name and version of the Compiler?
    What is the Compiler Installation Folder?

    If you do not know what a compiler is read this link http://www.cprogramming.com/compilers.html
    If you think Code::Blocks is a compiler read this link http://wiki.codeblocks.org/index.php...ocks_is_not.3F

    Tim S.
    Last edited by stahta01; 10-10-2011 at 03:22 PM.

  3. #3
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,909
    Also, you're writing C++ code, so you may want to post for help over on our C++ board.

  4. #4
    Third Eye Babkockdood's Avatar
    Join Date
    Apr 2010
    Posts
    352
    Code::Blocks is what's called an "integrated development environment" - it provides tools to help you edit your code, and to help you compile your code successfully, but it doesn't actually compile it. You need a compiler such as MinGW, and you need to tell Code::Blocks where the compiler is. This article should help you.
    Quote Originally Posted by The Jargon File
    Microsoft Windows - A thirty-two bit extension and graphical shell to a sixteen-bit patch to an eight-bit operating system originally coded for a four-bit microprocessor which was written by a two-bit company that can't stand one bit of competition.

  5. #5
    Registered User C4Robots's Avatar
    Join Date
    Oct 2011
    Location
    Warner Robins, Georgia
    Posts
    5

    Extra New Newbie

    Thanks for all the comments. First of all, I didn’t know Code::Blocks wasn’t a compiler, or at least that it didn’t include a compiler. That link was a good eye opener

    Second, I thought it was C (not C++) code. When I installed Code::Blocks, I chose the option for C and not for C++. Now what do I do if it’s not working with C like I want?

    Third, I went to “Plugins” in Code::Blocks and under “Installed Plugins” it lists Compiler 0.99. Does this mean I do have a compiler included as part of Code::Blocks? It lists a file in a certain path on my hard drive.

  6. #6
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    What was the Code::Blocks filename you used to install Code::Blocks?
    Did it have mingw in the filename?
    If not, then YOU still need to INSTALL a compiler!

    Tim S.

  7. #7
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    You may have told it you wanted to use the C compiler, but your example is C++. iostream is C++, as is the entire hello world line.


    Quzah.
    Hope is the first step on the road to disappointment.

  8. #8
    Registered User C4Robots's Avatar
    Join Date
    Oct 2011
    Location
    Warner Robins, Georgia
    Posts
    5
    Thanks again for the feedback. The Code::Blocks site wasn’t very clear on which version was supposed to include a compiler. I had chosen the first one listed, and the second one was the one that included the mingw reference. So I uninstalled the program and reinstalled using the second choice.

    I went through starting a project (including choosing C rather than C++ again) and saw that the code was obviously different, I’m guessing because it properly took my choice this time of using C instead of C++.

    Code:
    #include <stdio.h>
    #include <stdlib.h>
     
    int main()
    {
        printf("Hello world!\n");
        return 0;
    }
    But when I clicked on Build, I got the same error: “BruceFirst - Debug” uses an invalid compiler. Probably the toolchain path within the compiler options is not setup correctly. Skipping…”

    I clicked on Plugins and then on Manage Plugins, and saw “Compiler” among the list of Installed plugins, but I noticed when I clicked on it that the following message was displayed at the bottom of the page:
    This plugin is an interface to various compilers:
    GNU GCC compiler
    Microsoft Visual C++ Free Toolkit 2003
    Borland C++ Compiler 5.5
    Am I guessing correctly that the compiler that is now included is for C++ only?

  9. #9
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,909
    I'm not a Code::Blocks user, so I can't help you directly, but perhaps this tutorial we have will help: Cprogramming.com Tutorial: Setting up Code::Blocks and MINGW, A Free C and C++ Compiler, on Windows.

  10. #10
    Registered User C4Robots's Avatar
    Join Date
    Oct 2011
    Location
    Warner Robins, Georgia
    Posts
    5

    Extra New Newbie

    Thanks for taking time to try to help me, but I used that tutorial when I installed the program and tried to run it. I went back and made sure I followed everything in it, but I still get that error. Any other suggestions?

  11. #11
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by C4Robots View Post
    Thanks for taking time to try to help me, but I used that tutorial when I installed the program and tried to run it. I went back and made sure I followed everything in it, but I still get that error. Any other suggestions?
    Uninstall Code::Blocks... Install --> THIS

    As soon as the installer finishes, open the help file and start reading the "Integrated Environment" section, paying special attention to the "Your first project" tutorial...
    Last edited by CommonTater; 10-11-2011 at 07:12 PM.

  12. #12
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    Quote Originally Posted by CommonTater View Post
    Uninstall Code::Blocks... Install --> THIS
    If you plan to just program in C and NOT in C++; I suggest following Tater suggest of Pelles C.

    Code::Blocks is NOT really easy for newbie programmers; it is design/supported for people who already know how to use Compilers.
    There is no support for complete newbies to programming provided by Code::Blocks.

    Tim S.

  13. #13
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by stahta01 View Post
    If you plan to just program in C and NOT in C++; I suggest following Tater suggest of Pelles C.

    Code::Blocks is NOT really easy for newbie programmers; it is design/supported for people who already know how to use Compilers.
    There is no support for complete newbies to programming provided by Code::Blocks.

    Tim S.
    Best visit Pelles Forums my friend.... Pelles C now has an addin that provides VC++ support for the IDE...
    (You might recognize the author...)

    C++ for POIDE... Wizard and AddIn (32 and 64 bits)

  14. #14
    Registered User C4Robots's Avatar
    Join Date
    Oct 2011
    Location
    Warner Robins, Georgia
    Posts
    5

    Extra New Newbie

    Thanks for all the great advice. I'll give the new C program a whirl.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How is the Extra segment used?
    By cs32 in forum C Programming
    Replies: 3
    Last Post: 01-10-2008, 04:31 AM
  2. Cut off Extra data
    By pandadc in forum C++ Programming
    Replies: 8
    Last Post: 09-27-2006, 02:20 PM
  3. Extra Challenge...
    By agentomen in forum C Programming
    Replies: 9
    Last Post: 11-20-2005, 03:25 PM
  4. EOF reading one more extra
    By keithmolo in forum C++ Programming
    Replies: 11
    Last Post: 08-05-2003, 09:27 AM
  5. From where these two extra bytes came?
    By Juganoo in forum C Programming
    Replies: 4
    Last Post: 12-24-2002, 05:32 PM