randomhack
randomhack

Reputation: 11

How to complie C++ program on Google Compute Engine

I tried compiling C++ code on VM instance in Google Compute Engine

g++ -std=c++11 test.cpp -o output

It says bash: g++: command not found

I am not able to find any correct resource for this issue.

Upvotes: 1

Views: 1983

Answers (1)

user10448400
user10448400

Reputation: 29

"sudo apt-get install build-essential" will install latest version of c++ on your gcloud. One more modification I would do is "g++ test.cpp -o output" would be good for running. Let us know how it goes.

Upvotes: 1

Related Questions