Author Topic: Compilation  (Read 2491 times)

Offline John.H.Newman

  • Single posting newcomer
  • *
  • Posts: 2
Compilation
« on: March 06, 2016, 09:14:53 pm »
Hi everybody,

I installed the codeblocks in my computer, but after compilling my first program, it did nothing. Settings looks ok. Please, where could be the trouble?

Thank You very much,

Jan

Offline tigerbeard

  • Almost regular
  • **
  • Posts: 194
Re: Compilation
« Reply #1 on: March 06, 2016, 10:46:13 pm »
I guess with so little info you can not really expect an useful answer, can you? Try to be a bit more specific.
« Last Edit: March 07, 2016, 01:41:23 am by tigerbeard »

Offline John.H.Newman

  • Single posting newcomer
  • *
  • Posts: 2
Re: Compilation
« Reply #2 on: March 07, 2016, 09:01:20 am »
Hi,

I downloaded Code::Blocks 10.05. I wrote there standard program

#include <iostream>

using namespace std;

int main()
{
    cout << "Hello world!" << endl;
    return 0;
}

Global compiler setting looks ok. But it does nothing after debugging. No message.

Thank You.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Compilation
« Reply #3 on: March 07, 2016, 10:03:17 am »
Interesting why you've downloaded a version that is close to 6 years old and not the latest one, which is a few months old.
Also when you try the latest one please make sure you install a compiler (there is an installer with a compiler in the download section of our site).
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline tigerbeard

  • Almost regular
  • **
  • Posts: 194
Re: Compilation
« Reply #4 on: March 07, 2016, 12:31:13 pm »
Maybe you did use MSVS exclusively before?
I remember well when I switched from MS to CodeBlocks. It was not clear to me at all, that an IDE and a compiler and debugger are different things. Moreover a compiler and the debugger are again very different things. Using MSVS all this is a bit hidden away from you - you just do not need to know it always works.
In CodeBlocks this is a bit different. You can setup a lot. Eventually you need to understand the concepts or you are totally lost once a setting has been modified accidentially. But thats acutally a good thing, I think, because you are getting to know your tools, what they do and how they work beside getting to know you OS you are programming.

You have the choice which compiler you are using, you even can use serveral in parallel. It depends a bit what you want to do. If programming for Win, Linux and Mac is your target, you naturally to for the GNU compiler suite, which typically is installed as part of a package called MinGw. That also contain the OS libraries you would need to include for your program and the headers like conio.h that you used above. However, MinGw is a bad choice if you intend to write your own Super-High-End game for windows, only. There chances are high you want to use Direct3D, which is a nightare with MinGw imho. You are saving many grey hairs if you are using the mircosoft compiler for that.

The proposal from oBFusCATed is the best choice to start. Fore some years now there is a download package for CB that installs the compiler and debuger from MinGw into the CB directory and has the setup of them right included. I think that with MinGw you get  the best compiler / debugger integration that is available for CB, at least I am not aware of a better one. After installation select File/New/project and a wizard will set up anything for you, so that your potential issues should be limited to your program code and not your IDE setup. I am not at my PC right now, but I think somewhere in that wizard you may need to check that the compiler choice is set to GNU compiler (note that it doesn't say MinGw).

happy installing,
Tiger