https://github.com/appleboiy/helloworld.cpp
Hello world program in C++
https://github.com/appleboiy/helloworld.cpp
Last synced: 9 months ago
JSON representation
Hello world program in C++
- Host: GitHub
- URL: https://github.com/appleboiy/helloworld.cpp
- Owner: AppleBoiy
- Created: 2024-04-11T13:08:51.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-13T11:30:17.000Z (over 1 year ago)
- Last Synced: 2025-04-05T17:38:01.626Z (9 months ago)
- Language: Makefile
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hello, World! - C++
Logo endorsed by the C++ standards committee
## Description
`C++` is a general-purpose programming language created by [Bjarne Stroustrup](https://en.wikipedia.org/wiki/Bjarne_Stroustrup) as an extension of the [C programming language](), or "C with Classes". The language has expanded significantly over time, and modern `C++` has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
## The `CMakeLists.txt` File[^1]
For a simple `C++` project (e.g., a "Hello, World!" program), the `CMakeLists.txt`[^1] file is typically very simple.
```txt
.
├── CMakeLists.txt
└── src
└── hello_world.cpp
```
**_CMakeLists.txt_**[^1]
```cmake
# Set the minimum version of CMake that can be used
cmake_minimum_required(VERSION 3.5)
# Set the project name
project(HelloWorld)
# Add an executable
add_executable(hello_world src/hello_world.cpp)
```
### Running the Program
To run the program, follow these steps:
1. Run `CMake` to configure the project:
```bash
cmake .
```
2. Build the project:
```bash
make
```
4. Run the program:
```bash
./hello_world
```
**To clean the project:**
```bash
make clean-all
```
[^1]: `CMakeLists.txt` is a simple text file that is used to configure a project that is built using the `CMake` build system. The `CMakeLists.txt` file contains a set of directives and instructions describing the project's source files and targets (executable, library, or both). The `CMakeLists.txt` file must be present in the root directory of the project.