Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Eclipse CDT launched from GUI does not read $PATH in .bashrc /.bash_profile / .profile on Mac OS X
icon5.gif  Eclipse CDT launched from GUI does not read $PATH in .bashrc /.bash_profile / .profile on Mac OS X [message #1065953] Fri, 28 June 2013 13:21 Go to next message
Firman Azis Rauf is currently offline Firman Azis RaufFriend
Messages: 1
Registered: June 2013
Junior Member
Actually I can workaround the problem by launching Eclipse CDT from the Unix symbolic link. It is just annoying and wonder if it can be fixed to be launched normally like the JDT counterpart.

I am learning SDL and the SDL tutorial says use
`sdl-config --cflags`
in miscellaneous flag in the compiler flag settings. The build console output error message /bin/sh: sdl-config: command not found.

I found Eclipse CDT does not read environment variable settings in ~/.bash_profile or ~/.profile. So I just put
source .profile
in ~/.bashrc.

Using Eclipse terminal view plugin ELT (code.google.com/p/elt/) I found that now eclipse read that variable. But then again the console says sdl-config is not found.

I put echo $$PATH in prebuild step setting, and CDT now output

/usr/bin:/bin:/usr/sbin:/sbin


which is much shorter than my actual $PATH

/usr/hla:/opt/local/bin:/opt/local/sbin:/Users/firman/.rvm/gems/jruby-1.7.3/bin:/Users/firman/.rvm/gems/jruby-1.7.3@global/bin:/Users/firman/.rvm/rubies/jruby-1.7.3/bin:/Users/firman/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin


Why does CDT ignore environment variables when launched directly from the GUI? and how to fix it? my sdl-config is in usr/local/bin folder.

I put this question in stack overflow as well. stackoverflow.com/questions/17360737/eclipse-cdt-launched-from-gui-does-not-read-path-in-bashrc-bash-profile-p
Re: Eclipse CDT launched from GUI does not read $PATH in .bashrc /.bash_profile / .profile on Mac OS [message #1066136 is a reply to message #1065953] Mon, 01 July 2013 08:11 Go to previous message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
.bash_profile is only executed for login shells and ~/.bashrc is executed for non-login shells. They are not executed when you launch a GUI application. I would suggest you modify the environment variables directly in Eclipse.
Preferences->C/C++->Build->Environment


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Previous Topic:Including external libraries
Next Topic:Kepler changelog
Goto Forum:
  


Current Time: Thu Apr 25 17:53:58 GMT 2024

Powered by FUDForum. Page generated in 5.03669 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top