Like Tree1Likes

Code::Blocks run problem

This is a discussion on Code::Blocks run problem within the C++ Programming forums, part of the General Programming Boards category; Hello. I am trying to compile, build and run some codes, but they just won't run. It can't be from ...

  1. #1
    Registered User
    Join Date
    Sep 2011
    Posts
    24

    Unhappy Code::Blocks run problem

    Hello. I am trying to compile, build and run some codes, but they just won't run. It can't be from a wrong code, because I even tried the main.cpp. Nothing worked. What should I do?

  2. #2
    Registered User
    Join Date
    May 2009
    Posts
    2,771
    FAQ - CodeBlocks

    Did you try turning "full Compiler logging" the directions in the link above?

    Edit: If you have enable "full Compiler logging" what did Code::Blocks output?

    Tim S.
    Last edited by stahta01; 09-04-2011 at 11:59 AM.

  3. #3
    Registered User
    Join Date
    Sep 2011
    Posts
    24
    Heh, excuse me... What is full compiler logging?

  4. #4
    Registered User manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    Kolkata@India
    Posts
    2,528
    Quote Originally Posted by Coga1900 View Post
    Hello. I am trying to compile, build and run some codes, but they just won't run. It can't be from a wrong code, because I even tried the main.cpp. Nothing worked. What should I do?
    Maybe your program runs and finishes so quickly that you can't see. Try putting a cin.get(); in the line before return if you already haven't.
    Manasij Mukherjee | gcc-4.9.2 @Arch Linux
    Slow and Steady wins the race... if and only if :
    1.None of the other participants are fast and steady.
    2.The fast and unsteady suddenly falls asleep while running !



  5. #5
    Registered User
    Join Date
    May 2009
    Posts
    2,771
    Quote Originally Posted by Coga1900 View Post
    Heh, excuse me... What is full compiler logging?
    Did you try to follow the link?
    If not, follow it.

    This option will make Code::Blocks output the exact commands it uses to compile your code.
    Tim S.

  6. #6
    Registered User
    Join Date
    Sep 2011
    Posts
    24
    Okay, I put the cin.get(); (I hadn't thought of that, even than I knew about it) but it still won't build. When I build or "build and run", it does nothing, and if I try run, it says "It seems that your program hasn't been built yet. Do you want to build it now?" and if I press Yes, it still does nothing.

    Quote Originally Posted by stahta01 View Post
    Did you try to follow the link?
    If not, follow it.




    Tim S.
    What link?
    Last edited by Coga1900; 09-04-2011 at 12:33 PM.

  7. #7
    Registered User manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    Kolkata@India
    Posts
    2,528
    Okay, I put the cin.get(); (I hadn't thought of that, even than I knew about it) but it still won't build. When I build or "build and run", it does nothing, and if I try run, it says "It seems that your program hasn't been built yet. Do you want to build it now?" and if I press Yes, it still does nothing.
    I have a suspicion that you only installed the ide, not the compiler, if on windows.
    Manasij Mukherjee | gcc-4.9.2 @Arch Linux
    Slow and Steady wins the race... if and only if :
    1.None of the other participants are fast and steady.
    2.The fast and unsteady suddenly falls asleep while running !



  8. #8
    Registered User
    Join Date
    May 2009
    Posts
    2,771
    This link "http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_co mpiler_problem.3F"

    http://wiki.codeblocks.org/index.php...ler_problem.3F
    Last edited by stahta01; 09-04-2011 at 02:10 PM.

  9. #9
    Registered User
    Join Date
    Sep 2011
    Posts
    24
    I tried it, but it still does the same. But this time, when I press No, it gets a program window that says that it returned 0 value! I know that I'm tiring you, but I'm tired of all this, too!

  10. #10
    Registered User manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    Kolkata@India
    Posts
    2,528
    it gets a program window that says that it returned 0 value!
    That is your program running ! Put in some output statements to see what happens.

    If you get tired of this, wonder what you'll do in future, facing segfaults !
    Manasij Mukherjee | gcc-4.9.2 @Arch Linux
    Slow and Steady wins the race... if and only if :
    1.None of the other participants are fast and steady.
    2.The fast and unsteady suddenly falls asleep while running !



  11. #11
    Registered User
    Join Date
    Sep 2011
    Posts
    24
    You don't get it. It returns 0 value, but it gets no text! There is a cout, but it only returns the value! Nothing else!

  12. #12
    Registered User manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    Kolkata@India
    Posts
    2,528
    Paste the output of the terminal here.
    Manasij Mukherjee | gcc-4.9.2 @Arch Linux
    Slow and Steady wins the race... if and only if :
    1.None of the other participants are fast and steady.
    2.The fast and unsteady suddenly falls asleep while running !



  13. #13
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    22,303
    Quote Originally Posted by Coga1900
    Hello. I am trying to compile, build and run some codes, but they just won't run. It can't be from a wrong code, because I even tried the main.cpp. Nothing worked. What should I do?
    Your reasoning does not follow: just because a file is named "main.cpp" does not mean that it is immune from containing "wrong code".

    Have you ever successfully compiled and run a program using Code::Blocks? If not, create a new project and attempt to compile and run this program:
    Code:
    #include <iostream>
    
    int main()
    {
        std::cout << "Hello world!" << std::endl;
    }
    Then tell us what happened.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  14. #14
    Registered User
    Join Date
    Sep 2011
    Posts
    24
    That is the main.cpp!!!! It does nothing!

  15. #15
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    22,303
    Quote Originally Posted by Coga1900
    That is the main.cpp!!!!
    You are not telling the truth because...

    Quote Originally Posted by Coga1900
    It does nothing!
    My example prints "Hello world!"

    Obviously, you did not take my advice. I told you to create a new project. You don't have to do that if you can confirm that you have successfully used your IDE to build a C++ program, but you neglected to say anything about that.

    Basically, I am trying to rule out possible problems. Your failure to cooperate is just costing you time.
    stahta01 likes this.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Page 1 of 3 123 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 17
    Last Post: 07-08-2011, 08:11 AM
  2. Help with code::blocks
    By Souradeep in forum C++ Programming
    Replies: 6
    Last Post: 12-22-2010, 03:48 AM
  3. compilation problem........code::blocks...
    By Souradeep in forum C++ Programming
    Replies: 3
    Last Post: 12-20-2010, 03:04 AM
  4. Code Blocks compiling problem
    By Lehsyrus in forum Tech Board
    Replies: 2
    Last Post: 07-13-2010, 03:28 PM
  5. Code::Blocks problem
    By eaane74 in forum C++ Programming
    Replies: 6
    Last Post: 05-24-2007, 08:24 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21