# C++ Hello world program error

Status
Not open for further replies.

#### moin_moin

##### Newbie level 3
Hello

I am learning C++on my own by reading the book "Programming principles and practice using C++ by Bjarne Stroustrup"

They have started with a basic Hello world program.

Code:
//This program outputs the message "Hello, World  to the monitor
#include"std_lib_facilities.h"
int main() //C++ programs start by executing the function main
{
cout<<"Hello, World! \n"; //output "Hello,World! "
return 0;
}
I am getting this error
[Error] std_lib_facilities.h: No such file or directory

Thanks

#### andre_luis

##### Super Moderator
Staff member
Perhaps the path of this library is not proerly set on your system variables.

As a quick turn around, you could either: Make a search of the std_lib_facilities.h file in your entire disk and add the folder before the file name, or simply copy this file from where it was found to the project folder.

#### pic.programmer

You have to include iostream.h file.

#### CataM

I am getting this error
[Error] std_lib_facilities.h: No such file or directory
I think the way are called the library depends on your Compiler and if you not use same as used in that book maybe they give you errors.

However, the general way to write it is like this:

Code:
#include <cstdlib>
[B]#include <iostream>[/B]
[B]using namespace std;[/B]

int main()
{
cout<<"Hello, world"<<endl;

return 0;
}

NOTE: in C++ usually is used cstdlib instead of stdlib.h but it works however

moin_moin

### moin_moin

Points: 2

#### thannara123

You should add the #include"std_lib_facilities.h" header file . The compiler cant find the #include"std_lib_facilities.h" file .So you manually insert that one .

moin_moin and CataM

Points: 2

### moin_moin

Points: 2

#### moin_moin

##### Newbie level 3
Ya this is the only reason I found. Thanks

Status
Not open for further replies.