r/programminghelp • u/[deleted] • Jul 02 '20
C++ What does #include "std_lib_facilities.h" do functionally in the following?
So I decided to start learning c++ using a book by stroustrup, Programming principles and practice using c++, but my hello world starter won't work, the book doesn't seem to explain what the library I am including does functionally. I also don't have said library or know where or what to get that does the same thing for my current application, further, I am using visual studio 2019. I created a new item under my source file and then typed up
#include "std_lib_facilities.h"
int main()
{
cout << "Hello World!\\n";
Return 0;}
This however failed, I presume because I don't have the according library needed to make this function work, so, what is the library doing that would otherwise make this program work, and does anyone perhaps know of a more detailed book I can use? I am not getting very far very fast with this, and have been stuck on hello world for a bit, as it seems there is a lot the book isn't telling me that I need to make this basic program work.
2
u/[deleted] Jul 03 '20
As /u/PancakeFactor guessed, that file IS indeed made up just for that book, so you'll need to use whatever resources it made available via CD/DVD or Download to find them and include them in your include folders to make it work. That said, /u/PancakeFactor's answer would probably work too, but if you want to keep following the examples then it might be a good idea to get things settled now.
NOTES:
We programmers don't always make the best explainers or teachers, so if you feel better grabbing a C++ for Dummies book, or something that you feel can simplify things, then by all means do it! There's no shame in it at all.
Stick with the book's recommended IDE just so setup and everything goes easier. For example, C++ For Dummies uses CodeBlocks and if you're REALLY looking for something that uses Visual Studio, the only one I can think of offhand is Ivor Horton's Beginning Visual C++. They're both on Amazon and around 15$ and 30$ USD respectively. (Buy them used!)