Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

C++ Hello world program error

Status
Not open for further replies.

moin_moin

Newbie level 3
Joined
Jan 23, 2016
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
36
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

Please give me your comments about this error
Thanks
 

andre_luis

Super Moderator
Staff member
Joined
Nov 7, 2006
Messages
9,318
Helped
1,166
Reputation
2,351
Reaction score
1,152
Trophy points
1,403
Location
Brazil
Activity points
54,320
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.
 

CataM

Advanced Member level 4
Joined
Dec 23, 2015
Messages
1,275
Helped
314
Reputation
628
Reaction score
312
Trophy points
83
Location
Madrid, Spain
Activity points
8,418
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
 

thannara123

Advanced Member level 4
Joined
Jan 7, 2010
Messages
1,456
Helped
121
Reputation
242
Reaction score
111
Trophy points
1,353
Location
God's Own country India, India
Activity points
9,483
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 .
Look here may be helpful**broken link removed**
 

moin_moin

Newbie level 3
Joined
Jan 23, 2016
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
36
Ya this is the only reason I found. Thanks
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top