- May 21, 2013
- 3,656
- 60
- 91
I recently got a MBP for work, and have been working on getting it set up. I like to do most of my work in VS Code, and so I got the pre-requisite stuff installed. Full Xcode in order to install homebrew, and brew versions of gcc and make. The only brew packages I have installed are gcc, git, and make.
I have also placed the appropriate aliases in ~/.bash_profile and added the main brew directory to my PATH.
So, if I open my terminal app and type g++ --version, it reports back using the brew g++, which is exactly what I want.
VS Code's integrated terminal also provides the desired output when I type g++ --version, but this is where things get weird for me.
Executing a makefile from within VS Code's terminal (or any terminal for that matter) calls clang, Xcode's compiler. Not my brew compiler.
I am doing my work from a user account, brew stuff is installed via an admin account.
Hopefully someone knows the missing piece of my puzzle.
I have also placed the appropriate aliases in ~/.bash_profile and added the main brew directory to my PATH.
Code:
# A snippet of my ~/.bash_profile
export PATH=/usr/local/Cellar:$PATH
# An example alias
alias g++='g++-7'
So, if I open my terminal app and type g++ --version, it reports back using the brew g++, which is exactly what I want.
VS Code's integrated terminal also provides the desired output when I type g++ --version, but this is where things get weird for me.
Executing a makefile from within VS Code's terminal (or any terminal for that matter) calls clang, Xcode's compiler. Not my brew compiler.
I am doing my work from a user account, brew stuff is installed via an admin account.
Hopefully someone knows the missing piece of my puzzle.