Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: puneet_m on November 01, 2007, 07:34:08 pm

Title: Environment Variable
Post by: 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?
Title: Re: Environment Variable
Post by: Biplab on November 01, 2007, 07:47:54 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.
Title: Re: Environment Variable
Post by: dmoore on November 01, 2007, 07:49:59 pm
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.
Title: Re: Environment Variable
Post by: puneet_m on November 01, 2007, 08:33:57 pm
I have tried that, but code-Block is not reading it.

Thanks,
Title: Re: Environment Variable
Post by: dmoore on November 01, 2007, 09:21:55 pm
be a little more specific about what you are actually doing.
Title: Re: Environment Variable
Post by: puneet_m on November 01, 2007, 09:44:41 pm
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".
Title: Re: Environment Variable
Post by: dmoore on November 01, 2007, 09:54:01 pm
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
Title: Re: Environment Variable
Post by: puneet_m on November 01, 2007, 10:00:30 pm
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?
Title: Re: Environment Variable
Post by: dmoore on November 01, 2007, 10:07:29 pm
I thought it was a contrib plugin - have you installed those?