This is my first SE question. Usually I can find an answer to anything fairly easily through this great website, but unfortunately on this occasion I can\'t find anything on
Ok, I have got it to work, this may be of interest to many so I will post how I did it.
The problem was that Heroku's architecture is not the same as that on my machine and hence the compiled program simply would not run on Heroku. To get around this I created a makefile to compile the C++ source code and pushed this to Heroku using
$ git push heroku master
Then
$ heroku run bash
which essentially sets up a bash shell with access to your Heroku instance.
From here, compile the executable using
$ make
Then scp
this executable back to your local machine and then
$ git add .
$ git commit -m "added working executable"
and
$ git push heroku master
Then the working executable will be there on the Heroku app and will run just like on local host.