C++ runs on just about every computer supported by a (oftern large and sophisticated) collection of tools,
such as operating systems, compilers, editors, debuggers, build systems, and system specific libraries.
That's good, but when we want to start learning to program using C++, it leaves us with a huge problem:
which computer and which tools?
The language and its standard library is the same everywhere,
but the supporting tools differ, sometimes dramatically.
Often, I find getting the first simple program ("Hello, World" see Chapter 1)
to run on a system that's new to me a most frustrating experiences.
Once I learn the toolset well enought to get "Hello, World" entered into the system, compiled, and executed,
life's easier until I need to use something beyond the standard (e.g., Qt for Ch10) and I have to go through
another installation and learning experience.
If you can, get help.
An experienced friend, a colleague, a teaching assistent,
or someone like that can save you frustration by showing you how to get started.
It's usually not hard, but it might be completely novel and confusing to you.
First get an up-to-date C++ implementation.
Is there one on your computer already? If so, is it up-to-date?
If not, download and install one.
There are many implementations and they all seem to have a good free version for learners.
Start gently.
Don't head straight for the enterprise support features.
Please contact me if you have more useful information.
Some popular implementations:
On the web (for small examples):
Compiler Explorer.
It allows you to try many compilers.
Microsoft Visual Studio:
Search for the name or try
to download.
GCC:
Search for the name or try
to download.
Beware: installing a new GCC version is not a novice level task. If you can, ask for help.
Clang:
Search for the name or try
to download.
Beware: installing a new Clang/LLVM version is not a novice level task. If you can, ask for help.
Apple X-code:
Search for the name or try
to download.
They all come with installation and user guides.
Unfortunately, those guides are not always novice friendly,
and we are all novices when it comes to something brand new.
Initial use
Microsoft Visual Studio
Create a new "empty project" project with a name you consider suitable (e.g., "Hello").
Create a new .cpp file. Tab: file -> New -> File -> Visual C++ -> .cpp
Save your file in the directory/folder with the name of your project. Floppy disk icon (how quaint!).
Add your file to your project: Tab: File -> move file into project
Set the propeties of your project. Tab: Project -> Hello project.
General properties: Set "C++ language standard" to "latest"
C/C++ general: Scan for additional module dependencies: "yes"
Enter the simplest "Hello, World!" program, and hit "Local windows debugger"
Plain Linux (not using an SDE)
Create a Hello.cpp using your favorite editor.
Run "c++ --version" to see
(1) if there is a c++ command installed
(if not, try gcc instead of c++; if that doesn't work, figure out how to install C++)
(2) if the version is recent (if not figure out how to get a mor eup-to-date version)