I tried to run a basic C++ file in the terminal:
#include <iostream>
using namespace std;
int main() {
cont << "This is my first C++ program!";
return 0
}
And then tried to run it in the terminal:
make learningCPP.cpp
make: *** No rule to make target `learningCPP.cpp'. Stop.
And tried:
make learningCPP
make: *** No rule to make target `learningCPP'. Stop.
And tried:
gcc learningCPP.cpp -o learningCPP.out
clang: error: no such file or directory: 'learningCPP.cpp'
clang: error: no input files
Here is the entire Bash/Clang file:
Last login: Mon May 25 07:49:21 on console
make learningCPP.cpp
make: *** No rule to make target `learningCPP.cpp'. Stop.
make learningCPP
make: *** No rule to make target `learningCPP'. Stop.
gcc learningCPP.cpp -o learningCPP.out
clang: error: no such file or directory: 'learningCPP.cpp'
clang: error: no input files
$ g++ -o lab21 learningCPP.cpp
-bash: $: command not found
$ ./lab21
-bash: $: command not found
./learningCPP.cpp
-bash: ./learningCPP.cpp: No such file or directory
./main
-bash: ./main: No such file or directory
$ g++ -o main learningCPP.cpp
-bash: $: command not found
cpp
make learningCPP.cpp
run
How can I fix it?