Author Topic: How to buid and run a program  (Read 2845 times)


  • Guest
How to buid and run a program
« on: October 27, 2022, 11:09:21 pm »
Good evening/ morning to the gentlemen and ladies in the forum. I am quite new to this and I hope my post adheres to the group rules.
I am relatively a newbie to using code::blocks to write programs and execute them. I did C programming in university (graduated in 2008) but to a very basic level. I have recently decided to pick up programming , now in C++ cause I intend to grow my skill and build applications. To this end I will be writing a program or two a day for the next 90 days to see how far I will go from there.

My first program of today is as follows:

#include <iostream.h>
#include <conio.h>

int main()
    int value1, value2, sum;
    cout<<"Enter first value:";
    cout<<"Enter the second value:"
    sum = value1 + value2;
    cout <<"\n";
    cout << "The sum of the given values is: ";
    cout << sum;
    return 0;

just a simple program to add two numbers so really it shouldnt be a problem. However, something is amiss with my code::blocks because I am not being able to compile or run it and I suspect that I need some help setting up the code::blocks compiler. I am getting the following error message

Build file: " no target" in "no poject" (compiler: unknown)
fatal error: iostream.h: No such file or directory
Build failed: 1 error(s), ) warnings(s)

May someone advise me how to configure the compiler and also how to import a singular file into a project. Thank you


Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2787
Re: How to buid and run a program
« Reply #1 on: October 28, 2022, 12:55:31 am »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7607
    • My Best Post
Re: How to buid and run a program
« Reply #2 on: November 14, 2022, 11:57:14 pm »

Where did you install the Compiler?
What operating system?
What error did you get? Post the build log information.

Tim S.
« Last Edit: November 14, 2022, 11:58:45 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
When in doubt, read the CB WiKi FAQ.