News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Environment Variable

Started by puneet_m, November 01, 2007, 07:34:08 PM

Previous topic - Next topic

puneet_m

I have set an environment variable in my Code-Block project ABC. Now I am trying to read the file in project abc which stores the path with environment variable included in that. Will Code-Block be able to read the file using that environment variable?

Biplab

Quote from: puneet_m on November 01, 2007, 07:34:08 PM
I have set an environment variable in my Code-Block project ABC. Now I am trying to read the file in project abc which stores the path with environment variable included in that. Will Code-Block be able to read the file using that environment variable?

Why don't you try it on your own?? :shock:

Instead of asking others for a solution without even touching the problem, give it a try first. You know your requirements better than others.
Be a part of the solution, not a part of the problem.

dmoore

all processes spawned by cb should respect the environment vars that you set. but I agree with biplab, why don't you experiment with this before posting.

also, this post belongs in help or general, not in development.
Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]

puneet_m

I have tried that, but code-Block is not reading it.

Thanks,

dmoore

be a little more specific about what you are actually doing.
Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]

puneet_m

ok ..I have set an environment variable for my Project.
I am setting the variable at Project->Build Options->Custom Variables. Lets say I define a variable REP=C:\\Temp.
Now I am specifying the path of my files to be REP\\src\\base\\tinyxml.cpp
Then when I try to open this file by double click, "it says file not found".

dmoore

unfortunately, custom variables aren't environment variables, they only exist within cb scope. you need to use the environment variables plugin. set a group of environment vars in settings -> environment -> "environment variables" then activate that set globally with set now or in project scope using project -> properties -> envvar options
Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]

puneet_m

I am using the latest version of the code-block and I don't see any of these options in my code-block. So, do I need to install install any other plugin for environment variables?

dmoore

I thought it was a contrib plugin - have you installed those?
Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]