Chedi Bechikh
Chedi Bechikh

Reputation: 173

how to change the version of g++ in makefile

i have on my ubuntu 15.10 g++ complier 5, and i installed g++-4.2, by default the system will use the last version. How to choose in the makfile the right version should i replace in the makefile the

cc=g++

by

cc=g-4.2

is that correct

Upvotes: 1

Views: 2828

Answers (1)

Pierre
Pierre

Reputation: 1174

If the g++ executable name (in /usr/bin) is g++-4.2 then you can set CC=g++-4.2 in the Makefile

Or you can create a link inside /usr/bin from g++ to g++-4.2 with this command: cd /usr/bin && sudo ln g++-4.3 g++

Upvotes: 1

Related Questions