User forums > Help
Does cb_console_runner clear LD_LIBRARY_PATH????
(1/1)
dpu:
If I run a program from within Code::Blocks:
--- Code: ---Executing: xterm -T OsgVertexProgramTest -e /usr/bin/cb_console_runner /home/dunrau/src/dev/OsgVertexProgramTest/bin/Debug/OsgVertexProgramTest (in /home/dunrau/src/dev/OsgVertexProgramTest/.)
--- End code ---
LD_LIBRARY_PATH is not set, although other environment variables I define are. Why is this happening? More details below:
I'm running Code::Blocks 8.02 on ubuntu 8.10. I have a console app that needs some directories in LD_LIBRARY_PATH so that the required libraries can be found at run time. When I run the program from code::blocks, the libraries cannot be found. When I debug from within Code::Blocks, or run from a shell outside of Code::Blocks, the program runs fine. This is irrespective of whether I define LD_LIBRARY_PATH in my .bashrc, in Code::Blocks environment variables, or add the directories to the project->Build Options->Search directories->Linker area.
With this test program:
--- Code: ---#include <iostream>
#include <cstdlib>
using namespace std;
void printEnv(const char* pName)
{
char* pValue = getenv(pName);
if (pValue)
{
cout << pName << "=" << pValue << endl;
}
else
{
cout << pName << " not set" << endl;
}
}
int main()
{
char input[256];
cout << "Hello world!" << endl;
printEnv("PATH");
printEnv("DU_TEST");
printEnv("LD_LIBRARY_PATH");
printEnv("OSG_FILE_PATH");
cin >> input;
return 0;
}
--- End code ---
I can see that LD_LIBRARY_PATH values that I set are fine every way I run the program except if I run it from the Code::Blocks run icon. When I run the program this way, LD_LIBRARY_PATH is not set.
Any ideas why this is happening???? It seems this topic is the same problem: http://forums.codeblocks.org/index.php/topic,9197.0.html, but no solutions are listed....
MortenMacFly:
--- Quote from: dpu on October 21, 2008, 11:08:55 pm ---Any ideas why this is happening????
--- End quote ---
It's written in my post of the other thread you refer to:
--- Quote from: dpu on October 21, 2008, 11:08:55 pm ---http://forums.codeblocks.org/index.php/topic,9197.0.html
--- End quote ---
I'm afraid you need to modify the C::B sources slightly... Look for "LD_LIBRARY_PATH" in compilergcc.cpp of the compiler plugin. I can't tell more as I am not a Linux guy. Probably some other devs can provide additional information.
dpu:
Thanks - looks like that is the code that is controlling this. So, this is a bug then. I looked through compiler.gcc and I can't see an obvious problem. I can't find a bug report on this. Should I raise one???
Navigation
[0] Message Index
Go to full version