Install C++ Compilers in backtrack 5 r1
apt-get install build-essential
compiling your first C Program
1. gedit first.cpp
root@bt:~# gedit first.cpp
this will open gedit
2. paste in
#include <iostream>
using namespace std;
int main ()
{
cout << “Hello World!”;
return 0;
}
3. save and exit the file
4. compile the code using the following command
cc -c first.cpp
root@bt:~# cc -c first.cpp
5. then create an executable using the following command
g++ first.cpp -o first
root@bt:~# g++ first.cpp -o first
6. you can now run your file
./first
root@bt:~# ./first
Hello World!root@bt:~#
root@bt:~#
Advertisements