Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » How to change/set the default environment variable append setting?
How to change/set the default environment variable append setting? [message #1823639] Mon, 30 March 2020 14:50 Go to next message
John McCabe is currently offline John McCabeFriend
Messages: 228
Registered: July 2009
Senior Member
Can anyone tell me how to make sure that, when I add an environment variable in the "Environment" section under "C/C++ Build", it's set to replace any existing environment variable?

I seem to have had a fairly random collection of "operation=replace" and "operation=append" in my org.eclipse.cdt.core.prefs file for my projects; I'd like them all to be "replace".
I tried choosing "Replace native environments with the specified one", which changes the configuration's "appendContributed=true" to "appendContributed=false" in the org.eclipse.cdt.core.prefs file but, with it set that way, the whole environment's replaced including "PATH" etc which doesn't work for me.

I noticed there's an "append=true" setting in org.eclipse.cdt.core.prefs; how can I set that to false and, if so, will that do what I want?

Ultimately I can write a script to make sure they all say operation=replace but...

Thanks
John

[Updated on: Mon, 30 March 2020 15:23]

Report message to a moderator

Re: How to change/set the default environment variable append setting? [message #1830615 is a reply to message #1823639] Wed, 29 July 2020 20:13 Go to previous messageGo to next message
S. Shark is currently offline S. SharkFriend
Messages: 1
Registered: July 2020
Junior Member
I faced the same Problem in 2020-06.

It occurs if an entry in the list was created by "Add".
If it was created by "Select" (only possible if the environment variable was already defined outside eclipse) operation is replace.

If an entry in the list is selected and the "Edit" Button is pressed and the following "Edit variable" Dialog is closed with "OK", the operation will always be set to replace afterwards, which should solve your problem.

This logic seems to be coded in
https://github.com/eclipse-cdt/cdt/blob/master/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/EnvironmentTab.java
but I cannot find out if this obscure behaviour is somehow itentional or a bug.
Re: How to change/set the default environment variable append setting? [message #1830661 is a reply to message #1830615] Thu, 30 July 2020 16:43 Go to previous messageGo to next message
John McCabe is currently offline John McCabeFriend
Messages: 228
Registered: July 2009
Senior Member
Intriguing. Thanks for letting me know about this; I'll try that out and see what happens the next time I create a new one. It seems like very bizarre behaviour, but strangely in keeping with some of the recent Eclipse changes!
Re: How to change/set the default environment variable append setting? [message #1834227 is a reply to message #1830661] Thu, 05 November 2020 10:14 Go to previous message
Mark Smith is currently offline Mark SmithFriend
Messages: 82
Registered: September 2020
Member
Please check this article
https://www.schrodinger.com/kb/1842
Previous Topic:Debugger error
Next Topic:Hello World in Assembly in Eclipse CDT: Build Error
Goto Forum:
  


Current Time: Thu Oct 10 17:29:46 GMT 2024

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

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

Back to the top