Skip to main content



      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 10:50 Go to next message
Eclipse UserFriend
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 11:23] by Moderator

Re: How to change/set the default environment variable append setting? [message #1830615 is a reply to message #1823639] Wed, 29 July 2020 16:13 Go to previous messageGo to next message
Eclipse UserFriend
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 12:43 Go to previous messageGo to next message
Eclipse UserFriend
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 05:14 Go to previous message
Eclipse UserFriend
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: Sun Apr 27 10:49:07 EDT 2025

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

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

Back to the top