News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Linking to the non system libcodeblocks.a on Linux?

Started by oBFusCATed, October 21, 2011, 11:24:47 AM

Previous topic - Next topic

oBFusCATed

Hello,
Here is my setup:
1. I have locally modified source tree for the debuggers branch, built with codeblocks
2. I have a plugin, which I want to build against the modified version of C::B
3. I have installed version of C::B which has different SDK, than the local version
4. The plugin is setup to run the modified C::B as a host

The problem is that when I've modifications to the SDK, C::B refuses to start, when I hit run/debug->start in the plugin project.
I'm not sure what is the exact problem. Using the run.sh shell script works or running C::B from inside C::B used to build C::B works, too.
Also, I have the strange feeling that my plugin is not loaded correctly, I'm making obvious changes to the code, but they are not reflected :(

What can I do to improve the situation?
1. Install the modified SDK lib, this is the obvious solution, but the iteration time is extreme
2. Move libcodeblocks to a non system path and probably use rpath
3. Use the version numbers for the lib
4. Rename the lib, when building from C::B
(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!]

Jenna

I would try the second solution (rpath), because it seems the easiest way to set up.
If it does not work, try to set LD_LIBRARY_PATH with the environment variable plugin.

oBFusCATed

Quote from: jens on October 21, 2011, 01:09:53 PM
I would try the second solution (rpath), because it seems the easiest way to set up.
What should I change? The autotools files or the Codeblocks-unix.cbp
If it is autotools, where/what/how?

Quote from: jens on October 21, 2011, 01:09:53 PM
If it does not work, try to set LD_LIBRARY_PATH with the environment variable plugin.
This doesn't work, I've tried it. And I don't know why it doesn't work :(
But I know that the env plugin works for host apps/share library projects, because I'm using it at work!
When using the debugger, Codeblocks calls exit somewhere in the IMPLEMENT_APP macro :( I don't think it reaches the main function.
(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!]

Jenna

Adding
-Wl,-rpath=/path/to/codeblocks-root/src/devel
to the src-targets "Other linker options" (of the modified C::B) works for me.

Using LD_LIBRARY_PATH with envvar-plugin also works, but I had to manually activate the checkbox after modifying it.

oBFusCATed

#4
Patch? Do you change the C::B or the plugin?

Edit: -rpath in the src target in Codeblocks-unix.cbp does it (but it is not working 100% O_O)
Now I have to correctly link the libcodeblocks.a, do you know how. This is in the external plugin project?
(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!]

oBFusCATed

It turned out that I was doing
1. generate libmyplugin.so to the src/devel/share/plugins/
2. cp myplugins_path/libmyplugin.so to src/devel/share/plugins/

So, I was copying an old version to the new one. Stupid me. Sorry for the noise :(
(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!]