Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » build settings environment not saving
build settings environment not saving [message #203714] Fri, 26 October 2007 20:59 Go to next message
Eclipse UserFriend
Originally posted by: jim.marshall.wbemsolutions.com

Hi,
I hope I didn't miss a FAQ, sorry if I did.

Short story, I go to properties, select C/C++ Build and choose
'environment' and create a new variable. If I then exit eclipse and
restart eclipse, that variable is gone.... I would like the variable to
remain between invocations (and even get saved into the CVS version of
the project).

I have an existing make system which I have loaded into Eclipse CDT.
This make system uses some command line vars to make or environment vars
to inform the make system of the type of build to do. I created a new
project (file->New Project->C Project, I selected Makefile Project) and
pointed it at my top level directory. I then edited the configuration
(project->Build Configurations->manage...). I renamed the default one to
"Windows Debug" and created a new one called "Windows Release". I exited
that dialog, then select Project->Properties. I click on the C/C++
build, then select "Environment" option. In the dialog I create two new
variables "DEBUG_BUILD=1" and "PLATFORM=WIN32_GNU_GCC". Now if I exit
Eclipse and restart it both of those variables are gone.

Is there a way to maintain environment variables for different
configurations?

Essentially I need 2 configurations for each platform we support which
needs these vars set.


Eclipse
Version: 3.3.0
Build id: M20070921-1145

CDT
4.0.1.200709241202

Thanks
Re: build settings environment not saving [message #203752 is a reply to message #203714] Sun, 28 October 2007 11:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: vbagga.versant.com

Hi Jim,

This is known bug (https://bugs.eclipse.org/bugs/show_bug.cgi?id=205460)
that has been fixed. It was working with CDT 4.0.0.

... But unfortunately no one seems to have responded to my query about
how to get the nightly build (For 4.0.2) that would include this fix.

So you could either:

1) Wait till someone responds (might not happen at all)
2) Go back to CDT 4.0.0.
3) Try applying the patch yourself, I guess you would need to build the
CDT for that.

Regards,
- Vishal

Jim Marshall wrote, On 10/27/2007 2:59 AM:
> Hi,
> I hope I didn't miss a FAQ, sorry if I did.
>
> Short story, I go to properties, select C/C++ Build and choose
> 'environment' and create a new variable. If I then exit eclipse and
> restart eclipse, that variable is gone.... I would like the variable to
> remain between invocations (and even get saved into the CVS version of
> the project).
>
> I have an existing make system which I have loaded into Eclipse CDT.
> This make system uses some command line vars to make or environment vars
> to inform the make system of the type of build to do. I created a new
> project (file->New Project->C Project, I selected Makefile Project) and
> pointed it at my top level directory. I then edited the configuration
> (project->Build Configurations->manage...). I renamed the default one to
> "Windows Debug" and created a new one called "Windows Release". I exited
> that dialog, then select Project->Properties. I click on the C/C++
> build, then select "Environment" option. In the dialog I create two new
> variables "DEBUG_BUILD=1" and "PLATFORM=WIN32_GNU_GCC". Now if I exit
> Eclipse and restart it both of those variables are gone.
>
> Is there a way to maintain environment variables for different
> configurations?
>
> Essentially I need 2 configurations for each platform we support which
> needs these vars set.
>
>
> Eclipse
> Version: 3.3.0
> Build id: M20070921-1145
>
> CDT
> 4.0.1.200709241202
>
> Thanks
Re: build settings environment not saving [message #203772 is a reply to message #203752] Mon, 29 October 2007 01:13 Go to previous message
Eclipse UserFriend
Originally posted by: ronbermejo.yahoo.com

Vishal Bagga wrote:

> Hi Jim,

> This is known bug (https://bugs.eclipse.org/bugs/show_bug.cgi?id=205460)
> that has been fixed. It was working with CDT 4.0.0.

> ... But unfortunately no one seems to have responded to my query about
> how to get the nightly build (For 4.0.2) that would include this fix.

> So you could either:

> 1) Wait till someone responds (might not happen at all)
> 2) Go back to CDT 4.0.0.
> 3) Try applying the patch yourself, I guess you would need to build the
> CDT for that.

> Regards,
> - Vishal

Hi Vishal, Jim.

There's another option with CDT 4.0.1 which is a bit of a hack but works
if you cannot do options 1) to 3) above:

1. Open the ".cproject" file in a text or XML editor

2. Look for the <storageModule> element whose "name" attribute is equal to
the configuration you want the environment variables for. (e.g., for
"Debug" configuration)

<storageModule
buildSystemId=" org.eclipse.cdt.managedbuilder.core.configurationDataProvide r "
id="cdt.managedbuild.config.gnu.mingw.exe.debug.942367524"
moduleId="org.eclipse.cdt.core.settings" name="Debug">

3. Insert an <environment> element similar to the one below. Add
<variable> elements inside corresponding to each environment variable you
want to configure. Set the "name" and "value" attributes appropriately.
(e.g. this sets MYENVIRONMENTVARIABLE=abcdef)

<environment append="true" appendContributed="true">
<variable delimiter=";" name="MYENVIRONMENTVARIABLE" operation="append"
value="abcdef"/>
</environment>

4. Open the project in Eclipse. It should now be available. However, any
changes you make in the UI will not be persisted.

Hope this helps!
Ron
Previous Topic:Compilation Order in CDT (with MinGW)
Next Topic:Linking problem when using matlab engine under gcc
Goto Forum:
  


Current Time: Sat May 10 06:13:55 EDT 2025

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

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

Back to the top