简体   繁体   English

如何在makefile中更改g ++的版本

[英]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. 我在ubuntu 15.10 g ++编译器5上安装了g ++-4.2,默认情况下,系统将使用最新版本。 How to choose in the makfile the right version should i replace in the makefile the 如何在makfile中选择我应该在makefile中替换的正确版本

cc=g++

by 通过

cc=g-4.2

is that correct 那是对的吗

If the g++ executable name (in /usr/bin ) is g++-4.2 then you can set CC=g++-4.2 in the Makefile 如果g ++可执行文件名称(在/usr/bin )为g++-4.2则可以在Makefile中设置CC=g++-4.2

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++ 或者,您可以使用以下命令在/ usr / bin中创建从g++g++-4.2的链接: cd /usr/bin && sudo ln g++-4.3 g++

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM