Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » CDT doesn't save project environment variables
CDT doesn't save project environment variables [message #1792573] Thu, 19 July 2018 15:17 Go to next message
Peter Watkins is currently offline Peter WatkinsFriend
Messages: 4
Registered: February 2011
Junior Member
When I create a project environment variable using: Right-click on project->Properties->C/C++ Build->Environment->Add.. and add an environment variable setting, it doesn't persist to the next Eclipse session. In fact, CDT doesn't even write the setting to .project or .cproject.

Is anyone else running into this? Have you found any workarounds? Do you know if there are some tags I can manually add to .cproject?

[Updated on: Thu, 19 July 2018 15:28]

Report message to a moderator

Re: CDT doesn't save project environment variables [message #1792589 is a reply to message #1792573] Fri, 20 July 2018 02:54 Go to previous messageGo to next message
David VavraFriend
Messages: 777
Registered: October 2012
Senior Member
Worked for me in Photon (CDT 9.5.0)

The values are saved in <project dir>/.settings/org.eclipse.cdt.core.prefs
at least for me

Are you sure you created it in all build configurations?
If not, are you sure you are looking at the configuration where you created it?
Is the <project dir>/.settings directory write protected?

This is the file (<project dir>/.settings/org.eclipse.cdt.core.prefs) after:
   Debug configuration :  FORB=something
   all configurations  : FERN=plant


eclipse.preferences.version=1
environment/project/0.1665564934.1965880154.292122073/FERN/delimiter=\:
environment/project/0.1665564934.1965880154.292122073/FERN/operation=append
environment/project/0.1665564934.1965880154.292122073/FERN/value=plant
environment/project/0.1665564934.1965880154.292122073/append=true
environment/project/0.1665564934.1965880154.292122073/appendContributed=true
environment/project/0.1665564934.1965880154.956013310/FERN/delimiter=\:
environment/project/0.1665564934.1965880154.956013310/FERN/operation=append
environment/project/0.1665564934.1965880154.956013310/FERN/value=plant
environment/project/0.1665564934.1965880154.956013310/append=true
environment/project/0.1665564934.1965880154.956013310/appendContributed=true
environment/project/0.1665564934.1965880154/FERN/delimiter=\:
environment/project/0.1665564934.1965880154/FERN/operation=append
environment/project/0.1665564934.1965880154/FERN/value=plant
environment/project/0.1665564934.1965880154/FORB/delimiter=\:
environment/project/0.1665564934.1965880154/FORB/operation=append
environment/project/0.1665564934.1965880154/FORB/value=something
environment/project/0.1665564934.1965880154/append=true
environment/project/0.1665564934.1965880154/appendContributed=true


Won't be easy to do this manually if you don't know how those numbers were obtained.
Re: CDT doesn't save project environment variables [message #1792671 is a reply to message #1792589] Fri, 20 July 2018 18:26 Go to previous messageGo to next message
Peter Watkins is currently offline Peter WatkinsFriend
Messages: 4
Registered: February 2011
Junior Member
It is in all build configurations (there's only 1). I do see a previous value that got in <project dir>/.settings/org.eclipse.cdt.core.prefs somehow. However, setting a new environment variable doesn't result in a new entry in that file. The file isn't readonly. I see these errors in my Eclipse Error Log:

index.php/fa/33474/0/
Re: CDT doesn't save project environment variables [message #1792677 is a reply to message #1792671] Sat, 21 July 2018 03:47 Go to previous message
David VavraFriend
Messages: 777
Registered: October 2012
Senior Member
Sounds like a search of bugzilla is called for.
There's an old one (from 2009) that is similar.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=257495
Don't know if it's the same problem though.

You may need to file a new bug report.

You could also try deleting .settings/org.eclipse.cdt.core.prefs
or rename it
then try again.
Don't know why CDT would care.
Maybe something else has it open for write.
This is just a test not intended as a work around.

As I said, it works for me but I'm using Linux and not Windows.

Previous Topic:Can't debug (Windows 10)
Next Topic:Arduino "function" issue.
Goto Forum:
  


Current Time: Mon Sep 24 02:15:20 GMT 2018

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

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

Back to the top