I've c++ cmake project beginning-cpp20
.
The project structure as as below -
$ tree .
.
├── CMakeLists.txt
├── launch.json
└── meetingcpp.cpp
The contents of CMakeLists.txt
is -
cmake_minimum_required(VERSION 3.20)
project(BEGINING_CPP VERSION 1.0)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)
add_executable(meetingcpp meetingcpp.cpp)
The launch.json
is -
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug Emacs",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/meetingcpp",
"args": [],
"cwd":"${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb"
}
]
}
The meetingcpp.cpp
is -
#import<iostream>
int main() {
auto x = 66;
auto y = 14;
auto a= x + y;
std::cout << ++y + x + x << std::endl;
std::cout << a;
}
I compiled the program using command g++ -o meetingcpp meetingcpp.cpp
. Here is my ls output -
When I right click the file and choose Debug -
In the Debug template I choose Debug Emacs
then I get the below error -
What is the issue here? How can I fix this issue?