Thread: using codeblocks

  1. #1
    Registered User
    Join Date
    Feb 2011
    Posts
    39

    Cool using codeblocks

    Hi I just started using codeblocks and created a simple helloworld program (which was written automatically using C). The problem is that when i run it the screen that is supposed to pop up with the output doesn't show up, how can I fix this?

  2. #2
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    2,739
    You may have chosen a GUI project. Go to Project Properties and change it to console
    Devoted my life to programming...

  3. #3
    Registered User
    Join Date
    Feb 2011
    Posts
    39
    No, I used console. I got an error message this time which says ""random - Debug" uses an invalid compiler. Probably the toolchain path within the compiler options is not setup correctly?! Skipping..." any help on this?

  4. #4
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Are you sure the console isn't opening and closing again so fast you cant' see it?

    Try adding a getchar(); right before the return at the end of main.

    Code:
    int main (void)
      {
         puts("Hello World");
    
         getchar();
         return 0; }

  5. #5
    Registered User
    Join Date
    Feb 2011
    Posts
    39
    no it's not. I used codeblocks a while ago (earlier version) and had the same problem but I solved it by clicking on an option to display the output on a different screen but I don't see to have that option anymore.

  6. #6
    A source of questions... Benji Wiebe's Avatar
    Join Date
    Mar 2011
    Location
    Durham, Kansas
    Posts
    69
    Quote Originally Posted by torquemada View Post
    No, I used console. I got an error message this time which says ""random - Debug" uses an invalid compiler. Probably the toolchain path within the compiler options is not setup correctly?! Skipping..." any help on this?

    Code::Blocks v10.05 (this *might* work on older versions; I don't know)
    try this: Go to Settings->Compiler and Debugger
    click "Global Compiler Settings" on the left
    then find the "Toolchain Executables" tab
    click the button "Auto-Detect"
    If you have MinGW installed or installed Code::Blocks with MinGW it will find your executables.
    Everything should work then.

  7. #7
    Registered User
    Join Date
    Feb 2011
    Posts
    39

    Cool problem solved

    yayy, thanks I finally fixed it. Now I have another problem
    I am able to run a program but if I try to run another one then it gives me the output of the previous program.

  8. #8
    Registered User
    Join Date
    Feb 2011
    Posts
    39
    ok nm, I just realized about my mistake and everything is working fine
    thanks for the help bro

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Roulette in Codeblocks 10.5
    By Parid in forum C Programming
    Replies: 11
    Last Post: 12-19-2010, 01:53 PM
  2. Cant compile using Codeblocks 10.05
    By laimaretto in forum Windows Programming
    Replies: 2
    Last Post: 12-15-2010, 12:24 PM
  3. Codeblocks.
    By Kitt3n in forum C++ Programming
    Replies: 5
    Last Post: 05-16-2010, 01:50 PM
  4. C programming with codeblocks
    By caleb kennedy in forum C Programming
    Replies: 3
    Last Post: 09-25-2009, 08:29 AM
  5. problem with codeblocks
    By gnanasenthil654 in forum C++ Programming
    Replies: 2
    Last Post: 08-10-2009, 02:30 AM