User forums > Help

Examples

(1/3) > >>

ukimiku:
Hi,

I would like to learn C++ with Code::Blocks. I have downloaded and installed C::B, and manually added the MINGW compiler suite.

I would now like to test whether my Code::Blocks/Compiler setup is ready to go. Could any of you please post a first little sample program (maybe a console app) to test whether it compiles, builds, and runs? I'm using Windows Vista (hence the manual MINGW installation).

Thank you!

Regards

MortenMacFly:

--- Quote from: ukimiku on December 03, 2009, 01:18:49 pm ---Could any of you please post a first little sample program (maybe a console app) to test whether it compiles, builds, and runs?

--- End quote ---
Use the project wizard(s) to create yourself a console / any other app.

ukimiku:
Morten,

thank you. That was really over-obvious.
Anyhow, I ran into the problem that I, when attempting to compile even the tiniest Hello World sample, received a "...invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!].. skipping..." message. Turned out there were two MINGW directories, one with gcc 4.4.0, one with 3.4.5. Setting the latter as default finally worked.

Now, anytime I create a new project with a console app and compile the program for the first time, the "Hello World" does not appear. Instead, the console window comes up, empty. I then close the console. When I compile the app again, the "Hello World" appears, the process terminates gracefully (exit code 0). Do you happen to know why I have to compile everything twice before it works?

Regards

MortenMacFly:

--- Quote from: ukimiku on December 03, 2009, 04:25:14 pm ---Do you happen to know why I have to compile everything twice before it works?

--- End quote ---
To be honest: No. :( I never experienced such.

ukimiku:
Thanks for your help!
Regards

Navigation

[0] Message Index

[#] Next page

Go to full version