Author Topic: Environment Variables  (Read 12938 times)

Anonymous

  • Guest
Environment Variables
« on: June 09, 2005, 10:10:40 pm »
Hello, I have a few closely related questions:

1. Does CB currently support using environment variables as part of the include/link paths (in terms of using such a path, not in terms of specifying it - I know the latter is not suported through the IDE (right?)).

2. If the answer to 1 is positive, is there a cross-platform syntax to specify the environment variables?

3. What is the syntax to specify the environment variables (if there is one)?

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Environment Variables
« Reply #1 on: June 09, 2005, 10:48:16 pm »
$(SOME_ENV_VAR)

Yiannis.
Be patient!
This bug will be fixed soon...

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Environment Variables
« Reply #2 on: July 13, 2005, 05:27:36 am »
IMPORTANT NOTE:

With "environment variables" I think Yiannis referred to "Custom variables" specified elsewhere. And (someone correct me if i'm wrong) IIRC, using "real environment variables" wasn't supported in 1.0-finalbeta. It was added later in CVS.

darklordsatan

  • Guest
Environment Variables
« Reply #3 on: July 13, 2005, 06:32:38 am »
I might be blind but I dont see any option to specify "real environment variables", and I just compiled the CVS version...
In case Im wrong, were can I specify such option?
And last, is this related to the request of someone (who also pointed in the request to a thread where you were in, rickg22) in sf, relating "pre-command line" or something like this?

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Environment Variables
« Reply #4 on: July 13, 2005, 07:32:00 am »
hmm maybe i was wrong then. Sorry :oops:

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Environment Variables
« Reply #5 on: July 13, 2005, 08:51:36 am »
Quote
1. Does CB currently support using environment variables as part of the include/link paths (in terms of using such a path, not in terms of specifying it - I know the latter is not suported through the IDE (right?)).

This feature was added last week. You can use environment variables anywhere in compiler settings.

Quote
2. If the answer to 1 is positive, is there a cross-platform syntax to specify the environment variables?

3. What is the syntax to specify the environment variables (if there is one)?

You can use any of these forms, no matter what platform you work on:
Code
$SOMEVAR
$(SOMEVAR)
${SOMEVAR}
%SOMEVAR%


Yiannis.
Be patient!
This bug will be fixed soon...

darklordsatan

  • Guest
Environment Variables
« Reply #6 on: July 13, 2005, 09:39:58 am »
Yiannis, where exactly, I cant seem to make the PATH env variable to work (I use it inside my app, but I specify some values for it in custom variables and more options in compiler settings but nothing happens)

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Environment Variables
« Reply #7 on: July 13, 2005, 09:46:35 am »
Maybe I wasn't clear enough:
You cannot set environment variables, only use (aka read) them...
It's not difficult to set env vars too, but what's the point? They 'll only be valid while C::B is running...

[EDIT]: we are talking about the CVS version, right?

Yiannis.
Be patient!
This bug will be fixed soon...

darklordsatan

  • Guest
Environment Variables
« Reply #8 on: July 13, 2005, 09:58:27 am »
Oh! I get what you mean... and yes, its cvs were talking about

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Environment Variables
« Reply #9 on: July 13, 2005, 12:06:05 pm »
Well, now that we were talking about it, I 've found a bug in the implementation that would allow env vars only in global compiler options.
I 'm fixing it now and I 'm also adding the ability to set env vars :)

Yiannis.
Be patient!
This bug will be fixed soon...

darklordsatan

  • Guest
Environment Variables
« Reply #10 on: July 13, 2005, 12:25:09 pm »
Oh cool, I was actually starting to make a plugin to set environment vars (already have a somewhat implementation in project->set execution parameters), but you're the man.
Please tell me when you're done as Id like to test it!
Cheers

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Environment Variables
« Reply #11 on: July 13, 2005, 12:45:59 pm »
Follow up here.

Yiannis.
Be patient!
This bug will be fixed soon...