Author Topic: c++  (Read 4410 times)

Offline david4775

  • Single posting newcomer
  • *
  • Posts: 3
c++
« on: May 20, 2024, 08:49:47 pm »
I have made a first step on c++
I have downloaded code::blocks
I have copied a simple print program fromwww.w3schools.com
When I click on build and run nothing happens.
can someone advise me what I am missing, please ?
David

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1634
Re: c++
« Reply #1 on: May 21, 2024, 11:45:23 am »
"Nothing happens" is untrue, the build log must show some messages. Read this at least twice and repost.

Offline david4775

  • Single posting newcomer
  • *
  • Posts: 3
Re: c++
« Reply #2 on: May 23, 2024, 06:10:42 am »
Dear Miguel. Thank you for replying to my query on the forum.
I realise your role is to help with more complex problems, but I seek to offer a report.
I have written thousands of lines of source code in Basic, and in Z80 and 6809 Assemly language, but this foray into C++ with Codeblocks has got me baffled.
I have studied the information that you kindly made available.
The only response in the lower box is "checking the existence of............".   
When I can get the Command line to appear, It will not accept any input.
It is regrettable that this simplest source code program does not work  on Codeblocks  (It works perfectly on an Online C++ Compiler). I am assuming that "build and run" means "compile and execute"
If I cannot get a simplest routine to work on Codeblocks, then I am lost.
Today`s beginner can be  tomorrow`s dedicated user, but it is not working at the simplest level.
David.

Offline nenin

  • Almost regular
  • **
  • Posts: 228
Re: c++
« Reply #3 on: May 23, 2024, 07:40:39 am »
OK, try it like this:
1. Open C::B
2. Create new project (something like "console application")
2.1. Select C++
2.2 Finalize creation
3. Open "main.cpp"
4. CopyPaste your code in "main.cpp"
5. Save everything, just in case
6. Build the project
7. Run

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1634
Re: c++
« Reply #4 on: May 23, 2024, 09:14:24 am »
Quote
The only response in the lower box is "checking the existence of............".

Was the check successful?. You have not posted the build log, so we do not know if compilation failed, running is failing or the program runs but does not work as intended.

I have also programmed thousand of lines in 6502, 68000, Z80 and small microcontrollers, and I learnt to use the tool's logs whenever something failed.

Offline david4775

  • Single posting newcomer
  • *
  • Posts: 3
Re: c++
« Reply #5 on: May 24, 2024, 08:11:33 am »
Dear Miguel and also Nenin, Thank you both for your kind replies. I will work on the information provided.
David.