Automatic loading of needed shared libraries
-
- CodeLite Expert
- Posts: 159
- Joined: Mon Nov 03, 2008 9:17 pm
- Contact:
Automatic loading of needed shared libraries
Hi, I have two questions:
1) Is possible to make CL to load needed shared libraries (DLL, so,...) at a startup of application which links with them without need to have these shared libraries correctly installed in the system?
2) Is possible to defined project dependencies across a workspace? For example, can CL automatically rebuild also project linked with another project (static library) opened in the CL?
Btw, CL is realy great IDE! Keep coding...
1) Is possible to make CL to load needed shared libraries (DLL, so,...) at a startup of application which links with them without need to have these shared libraries correctly installed in the system?
2) Is possible to defined project dependencies across a workspace? For example, can CL automatically rebuild also project linked with another project (static library) opened in the CL?
Btw, CL is realy great IDE! Keep coding...
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Automatic loading of needed shared libraries
I am not sure what do you mean here, but have you tried using 'dlopen' or wxDynamicLIbrary?marfi wrote:1) Is possible to make CL to load needed shared libraries (DLL, so,...) at a startup of application which links with them without need to have these shared libraries correctly installed in the system?
Have you tried the project context menu, 'settings -> build order...' ?marfi wrote:2) Is possible to defined project dependencies across a workspace? For example, can CL automatically rebuild also project linked with another project (static library) opened in the CL?
Still ammarfi wrote:Btw, CL is realy great IDE! Keep coding...
Eran
Make sure you have read the HOW TO POST thread
-
- CodeLite Expert
- Posts: 159
- Joined: Mon Nov 03, 2008 9:17 pm
- Contact:
Re: Automatic loading of needed shared libraries
In my previous post I meant this behaviour:
I have a project which uses (links with) my custom shared library which is not installed in the system (it means that it is not located in standard system path). If I run my app then I get error message telling me that the shared library couldn't be found (that is obvious - this error message disappears after correct installation of the shared library and everything works fine). But, If I do the same thing in Code::Blocks IDE (maybe also in VS), then the IDE loads the requested library for me without need of its installation. Is this behaviour supported by CL as well? In my opinion this approach is very useful for developping/debugging of shared libraries - I'm not forced to install them to the system after every code change...
I have a project which uses (links with) my custom shared library which is not installed in the system (it means that it is not located in standard system path). If I run my app then I get error message telling me that the shared library couldn't be found (that is obvious - this error message disappears after correct installation of the shared library and everything works fine). But, If I do the same thing in Code::Blocks IDE (maybe also in VS), then the IDE loads the requested library for me without need of its installation. Is this behaviour supported by CL as well? In my opinion this approach is very useful for developping/debugging of shared libraries - I'm not forced to install them to the system after every code change...
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Automatic loading of needed shared libraries
Yes, CodeLite supports that.marfi wrote:In my previous post I meant this behaviour:
I have a project which uses (links with) my custom shared library which is not installed in the system (it means that it is not located in standard system path). If I run my app then I get error message telling me that the shared library couldn't be found (that is obvious - this error message disappears after correct installation of the shared library and everything works fine). But, If I do the same thing in Code::Blocks IDE (maybe also in VS), then the IDE loads the requested library for me without need of its installation. Is this behaviour supported by CL as well? In my opinion this approach is very useful for developping/debugging of shared libraries - I'm not forced to install them to the system after every code change...
- go to 'settings -> environment variables'
- define new environment variable named: PATH
as value set: $(PATH);/path/to/your/shared/library
(replace /path/to/your/shared/library with the actual path ofc)
Note: the $(PATH); is very important!
Now CodeLite will be able to locate your shared libraries without the need for them to be installed.
Eran
Make sure you have read the HOW TO POST thread
-
- CodeLite Expert
- Posts: 159
- Joined: Mon Nov 03, 2008 9:17 pm
- Contact:
Re: Automatic loading of needed shared libraries
Hi, thank you for your fast reply, unfortunately it doesn't work... I set the PATH environment variable as you described (I used the same path to the shared library like in the linker setting - without the name, of course), compilation and linking works fine, but if I want to run the app it still cannot locate the shared library. Do I omit something important in the project/IDE settings? I attached the project file and the environment configuration file bellow.eranif wrote:Yes, CodeLite supports that.marfi wrote:In my previous post I meant this behaviour:
I have a project which uses (links with) my custom shared library which is not installed in the system (it means that it is not located in standard system path). If I run my app then I get error message telling me that the shared library couldn't be found (that is obvious - this error message disappears after correct installation of the shared library and everything works fine). But, If I do the same thing in Code::Blocks IDE (maybe also in VS), then the IDE loads the requested library for me without need of its installation. Is this behaviour supported by CL as well? In my opinion this approach is very useful for developping/debugging of shared libraries - I'm not forced to install them to the system after every code change...
- go to 'settings -> environment variables'
- define new environment variable named: PATH
as value set: $(PATH);/path/to/your/shared/library
(replace /path/to/your/shared/library with the actual path ofc)
Note: the $(PATH); is very important!
Now CodeLite will be able to locate your shared libraries without the need for them to be installed.
Eran
You do not have the required permissions to view the files attached to this post.
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Automatic loading of needed shared libraries
You forgot to mention your OS (which by the path you added, I figured it is LInux)
Chnage the environment variable to:
$(PATH):/home/michal/Src/Projekty/wxSF/lib/gcc_dll
Notice that I used here ':' as separator unlike earlier where you set ';' (which is relevant for Windows)
Eran
Chnage the environment variable to:
$(PATH):/home/michal/Src/Projekty/wxSF/lib/gcc_dll
Notice that I used here ':' as separator unlike earlier where you set ';' (which is relevant for Windows)
Eran
Make sure you have read the HOW TO POST thread
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Automatic loading of needed shared libraries
Thinking of it now... it wont work.
PATH is the proper variable to set under windows, on Linux:
Do the same as you did with PATH but for LD_LIBRARY_PATH
And of course, use colons as the separator ':'
Eran
PATH is the proper variable to set under windows, on Linux:
Do the same as you did with PATH but for LD_LIBRARY_PATH
And of course, use colons as the separator ':'
Eran
Make sure you have read the HOW TO POST thread
-
- CodeLite Expert
- Posts: 159
- Joined: Mon Nov 03, 2008 9:17 pm
- Contact:
Re: Automatic loading of needed shared libraries
Oops, sorry for that: I use Ubuntu 8.10, wxWidgets 2.8.9. I really don't want to waste your time, maybe I'm awkward, but it still doesn't work... I tried to modify the PATH var in some ways and in some cases the CL wasn't able even to compile (so it means it really processes the ENV vars ), but the app cannot be ran.eranif wrote:You forgot to mention your OS (which by the path you added, I figured it is LInux)
Chnage the environment variable to:
$(PATH):/home/michal/Src/Projekty/wxSF/lib/gcc_dll
Notice that I used here ':' as separator unlike earlier where you set ';' (which is relevant for Windows)
Eran
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Automatic loading of needed shared libraries
You should read my later post about you needing to modify LD_LIBRARY_PATH instead of PATH
Eran
Eran
Make sure you have read the HOW TO POST thread
-
- CodeLite Expert
- Posts: 159
- Joined: Mon Nov 03, 2008 9:17 pm
- Contact:
Re: Automatic loading of needed shared libraries
I was writing my last post simultaneously to you were doing the same so I missed it. Unfortunately it still doesn't work but maybe I found out reason why:
If I do the recommended steps from the command line in the following way everything goes well:
<- OK
But, if I try run my app via xterm like the CL does, it doesn't work. It seems like the xterm doesn't use LD_LIBRARY_PATH variable.
<- ERROR
If I do the recommended steps from the command line in the following way everything goes well:
Code: Select all
$ export LD_LIBRARY_PATH=/home/michal/Src/Projekty/wxSF/lib/gcc_dll/
$ ./wxSFDemo
But, if I try run my app via xterm like the CL does, it doesn't work. It seems like the xterm doesn't use LD_LIBRARY_PATH variable.
Code: Select all
$ export LD_LIBRARY_PATH=/home/michal/Src/Projekty/wxSF/lib/gcc_dll/
$ xterm -title './wxSFDemo ' -e /bin/sh -f /usr/local/bin/le_exec.sh ./wxSFDemo