Any ideas?
OK, I think I know why and this is not "nice". You said you compile C::B yourself. Can you do me a favour and search for the following in the compiler plugins's
compilergcc.cpp file (should be in
CompilerGCC::SetupEnvironment()):
if (!m_OriginalPath.IsEmpty())
wxSetEnv(_T("PATH"), m_OriginalPath);
...and replace it with:
if (!m_OriginalPath.IsEmpty())
{
Manager::Get()->GetLogManager()->DebugLog(_T("Setting up compiler PATH environment..."));
wxSetEnv(_T("PATH"), m_OriginalPath);
}
Then search for (should be in
CompilerGCC::SetEnvironmentForCompiler()):
envPath = envPath + GetStringFromArray(envPathArr, path_sep, false);
wxSetEnv(_T("PATH"), envPath);
...and replace it with:
envPath = envPath + GetStringFromArray(envPathArr, path_sep, false);
Manager::Get()->GetLogManager()->DebugLog(_T("Updating compiler PATH environment..."));
wxSetEnv(_T("PATH"), envPath);
Then compile, run C::B with the debug console and inspect when C::B sets the PATH from the compiler and from the Envvars plugin respectively. I have the feeling that the compiler "resets" the PATH when you hit compile.
If that is the case, I need to think about a new concept for this (this applies to the PATH environment only!!!).
In the meantime, you have these work-arounds:
1.) In the project options, setup the "execution working dir" for your targets to the allegro bin folder.
2.) In the compiler setup, append the path to the allegro bin folder under "additional paths".
3.) Depending on your platform, adjust the PATH environment variable "globally" (per user).
EDIT: Oh and for testing, you can use a simple "command only" project as this (
MyCmd.cbp):
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="MyCmd" />
<Option compiler="gcc" />
<Build>
<Target title="default">
<Option type="4" />
<Option compiler="gcc" />
<ExtraCommands>
<Add before="echo <PRE_BUILD>" />
<Add before="echo %PATH%" />
<Add before="echo </PRE_BUILD>" />
<Add after="echo <POST_BUILD>" />
<Add after="echo %PATH%" />
<Add after="echo </POST_BUILD>" />
<Mode after="always" />
</ExtraCommands>
</Target>
</Build>
<Extensions>
<envvars set="dummy" />
</Extensions>
</Project>
</CodeBlocks_project_file>