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 doesn't work with Scons

Started by a71128, July 31, 2017, 05:41:00 PM

Previous topic - Next topic

a71128

Hey guys,
I am trying to import my scons project into CB. However, I can't seem to set environment variables correctly because my scons script always shows variables missing.
Does anyone have experience with this? I would appreciate any input.
Thanks!

Best,
a71128


a71128

I am running Code::Blocks version 16.01 on Ubuntu 14.04.
The compiler I use is GNU GCC version 4.8.4.

When I try to build my code with custom scons setup.
It shows
Error : environment variable DIR/CONFIG_DIR is not defined
        Please thoroughly read the file: README
        found at the root level of the Ottomatika directory and follow
        all of the instructions listed there.
        The short fix is to add to your .bashrc file the line:
          export DIR=YOURPATH/ottomatika/codebase
          export CONFIG_DIR=$OTTO_DIR/config
       
from the SConscript.

I have already tried exporting the variable in the pre-build steps, defining custom variables, and setting global variable but none of them work.

Thanks!

oBFusCATed

What are you really trying to do?
Create a custom makefile project that executes scons for building?
Have you tried the env var plugin (http://wiki.codeblocks.org/index.php/Environment_Variables_plugin)?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

a71128

Quote from: oBFusCATed on July 31, 2017, 08:23:48 PM
What are you really trying to do?
Create a custom makefile project that executes scons for building?
Have you tried the env var plugin (http://wiki.codeblocks.org/index.php/Environment_Variables_plugin)?
Yes, that is exactly what I would like to achieve.
I wanted to try the env var plugin. However, I  couldn't find the link to the install file.

stahta01

Quote from: a71128 on July 31, 2017, 08:48:05 PM
Quote from: oBFusCATed on July 31, 2017, 08:23:48 PM
What are you really trying to do?
Create a custom makefile project that executes scons for building?
Have you tried the env var plugin (http://wiki.codeblocks.org/index.php/Environment_Variables_plugin)?
Yes, that is exactly what I would like to achieve.
I wanted to try the env var plugin. However, I  couldn't find the link to the install file.

Make sure you have the codeblocks contrib package installed via the normal Linux package installer method.

Then, in Code::Blocks look under "Plugins" -> "Manage Plugins..." to verify the Env Vars plugin is listed and enabled.

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

BlueHazzard

And then you can enable the environment variables via
Project->Properties->EnVars option

and set the environment variables via:
Settings->Environment->Environment variables

You can use variable expansion to define environment variables: http://wiki.codeblocks.org/index.php/Variable_expansion

a71128