如何更改gcc的GNU Make的(默认)默认位置


0

我运行Mac OS X El Capitan 10.4。我已经使用brew安装了编译工具(https://www.topbug.ne​​t/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/) 。

现在,当我运行make时,它仍然会附加到:

 /Applications/Xcode.app/Contents/Developer/usr/bin/g++ -c -pipe -stdlib=libc++ -fstack-protector-all --param ssp-buffer-size=1 -O2 -std=gnu++11 -isysroot 


/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -mmacosx-version-min=10.7 -pthread -fdiagnostics-show-option -Wall -Wextra -Wno-ignored-qualifiers -Wformat -Wformat-security -Wno-unused-parameter -Wstack-protector -fPIC -DENABLE_WALLET -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE -DUSE_NATIVE_I2P -DUSE_NUM_NONE -DUSE_FIELD_INV_BUILTIN -DUSE_SCALAR_INV_BUILTIN -DUSE_FIELD_10X26 -DUSE_SCALAR_8X32 -DQT_DISABLE_DEPRECATED_BEFORE=0 -DUSE_UPNP=1 -DMINIUPNP_STATICLIB -DSTATICLIB -DHAVE_BUILD_INFO -DMAC_OSX -DMSG_NOSIGNAL=0 -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -Isrc -Isrc/json -Isrc/qt -Isrc/tor -Isrc/qt/plugin

现在,我希望将其更改为

/usr/local/bin/g++

那么,如何?

Answers:


1

将以下行添加到您的.bash_profile中:

export PATH=/usr/local/bin:$PATH

为确保能正常工作,请重新启动终端,然后:

echo $PATH

这将输出您的PATH变量。目录在PATH变量中的顺序很重要。因此,为了如您所说的那样工作,结果应以/ usr / local / bin开头

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.