Izaac
Posts: 3
Joined: Sat Sep 01, 2018 9:56 pm

C++

Mon Sep 03, 2018 7:19 pm

I have been wanting to learn C++ for over a year now, and develop games. I can't seem to access it on my raspberry pi 3. If someone could help me that would be great! thanks in advance!

User avatar
Paeryn
Posts: 2211
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: C++

Mon Sep 03, 2018 9:19 pm

What OS are you using, it should be installed already on Raspbian (not sure if it is for Raspbian Lite but I would have thought so). The default compiler is g++ though you can also call it with c++.

If it isn't installed it should be installable with

Code: Select all

sudo apt install g++
She who travels light — forgot something.

danjperron
Posts: 3094
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: C++

Mon Sep 03, 2018 9:25 pm

nano hello.cpp

Code: Select all

#include "iostream"

using namespace std;

int main(void)
{

   cout << "hello world" << endl;
   return 0;
}
[email protected]:~ $ nano hello.cpp
[email protected]:~ $ g++ -o hello hello.cpp
[email protected]:~ $ ./hello
hello world

jahboater
Posts: 3250
Joined: Wed Feb 04, 2015 6:38 pm

Re: C++

Mon Sep 03, 2018 10:04 pm

Paeryn wrote:
Mon Sep 03, 2018 9:19 pm
not sure if it is for Raspbian Lite but I would have thought so
It is included with Raspbian Lite.

Return to “C/C++”