Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

EnvVars Plugin and PATH

(1/9) > >>

pkrcel:
Hi there,
  I noticed a strange behavior when setting PATH EnvVar with help of the EnvVars Plugin.

I am doing a simple "hello world" kind of program using Allegro 5.0.5 Libray, and set up a very simple project with a single "main.c" and 4 targets (Debug and Release, both and dinamically statically linked to the library).

Compiling and linking is no problem and each target built correctly (and works :) )

Still, the dll's to with I dynamically link aren't in the executable path nor in Win7 %PATH%, so I defined a "liballeg" set of a single Envvar (also set to be used in the EnVars tab of project properties) "PATH" with value "%PATH%;pathtoliballegro;pathto mingwruntime libraries" (see attached pictures).

This allows me to run the dynamically linked executables without actually changing PATH in the windows environment

Well, everything works fine until I press "build" (EVEN if the current target is up to date and nothig has tobe done), then the dynamically linked executables fails to start up and the OS is giving the "unable to find dll" error message.

If I go to the envVars panel and press "set now" or I go in the envVars tab in project properties and set again the (same) set of envvars, then the executables are able to find their dll...

This does not seem the intended behavior, but maybe I am doing something wrog so I am asking if this could be a bug or is only my fault.

I am using the latest official release of C::B (10.05) over Win7, and MinGW 4.5.2 toolchain (NOT the one bundled in C::B).

Images




Thanks for any help

Alpha:
I have not used the EnvVars plugin before, so I could be completely wrong, but I believe what it sets are global/per-project variables (not variables in the system environment).

Something you could try is to have add your bin folder (C:\Users\Provasi\_user\Coding\Libraries\allegro-5.0.5-mingw-4.5.2\bin) to both the compiler and the linker search directories of your project.

pkrcel:
Since I am in the office, I may only be able to try this later, but I'm under the impression that it will not work...and exe looking for an external launches an OS call so I guess that the OS EnvVars are involved in the process, not compiler nor linker.

Besides, C::B correctly detects that PATH is a system EnvVar and explicitly tells that whichever value I set it will be done recursively (meaning, I guess, that the current PATH will have those value appended, not substituted).

Setting PATH in Win7 of course does the trick, but I'd like to understand if the EnvVars plugnin can be used in this way or not.

EDIT: having gone (again) through the Wiki you linked me, seems that the envvvars plugin is specifically designed to dabble with system EnvVars, as I deducted reading here

oBFusCATed:
Alpha: You are wrong here. It sets system env variables and at least on linux it works as expected.

pkrcel: Can you try with the latest nightly build?

MortenMacFly:

--- Quote from: oBFusCATed on February 10, 2012, 08:58:30 am ---pkrcel: Can you try with the latest nightly build?

--- End quote ---
In addition: Can you enable the ennvars "debug log" (Settings -> Environment -> Envvars) and C::B's "debug log" (by starting C::NB with the command line option --debug-log) and post what the plugin does here? It's written to the debug log then.

Navigation

[0] Message Index

[#] Next page

Go to full version