News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

C::B Portable: libcodeblocks.so.0 error

Started by Gublerian, March 15, 2010, 12:50:17 PM

Previous topic - Next topic

Gublerian

I successfully compiled the last trunk release according to this manual: http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Linux#Code::Blocks_installation

I also wrote a script as described here: http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_make_Code::Blocks_portable.3F

When I run it I get the following error:
codeblocks: error while loading shared libraries: libcodeblocks.so.0: cannot open shared object file: No such file or directory

I have seen the solution to this at the bottom of the first page (http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Linux#Resolving_issues)

But: As my intention is to create a portable version of Code Blocks, I can't do this on every computer I where I want to run Code Blocks because I'm not always root. I also think that the idea behind a portable edition is to run on every computer, without making changes to it.

I compiled width Ubuntu 9.10, but the portable version should run on any (normal) distribution.

What do you suggest to do? Do you know any other solution?

Thanks.

MortenMacFly

Did you try the CODEBLOCKS_DATA_DIR command line switch / envvar?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

Jenna

Quote from: MortenMacFly on March 15, 2010, 08:33:06 PM
Did you try the CODEBLOCKS_DATA_DIR command line switch / envvar?
I don't think that it will work, because it's an issue of linux not finding the dynamic lib.

I suggest using a shell-script to start C::B and dynamically set LD_LIBRARY_PATH to the dir libcodeblocks.so* (and the other so's) reside.
Should not be needed for the plugins so's.

MortenMacFly

Quote from: jens on March 15, 2010, 09:23:28 PM
Quote from: MortenMacFly on March 15, 2010, 08:33:06 PM
Did you try the CODEBLOCKS_DATA_DIR command line switch / envvar?
I don't think that it will work, because it's an issue of linux not finding the dynamic lib.
Ah - sorry, that is correct.
Linux was the OS unable to self-relocate... right?! :lol: :lol: :lol:
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

Gublerian

QuoteI suggest using a shell-script to start C::B and dynamically set LD_LIBRARY_PATH to the dir libcodeblocks.so* (and the other so's) reside.
Thanks for your quick reply. This works!

Now I have the next error:
Quoteerror while loading shared libraries: libwx_gtk2u_richtext-2.8.so.0: cannot open shared object file: No such file or directory

I think this is because I didn't compile wxGTK. Instead I installed it with the package manager (on the system where I compiled Code Blocks). But on the target system wxGTK is not available (and I have no root rights). What do you suggest?
Atm I'm trying two things:

  • copy all missing library files from my local system to the Code Blocks Portable /lib Folder. This gave me a segmentation fault when trying to run code blocks
  • compile wxGTK, and put it into the /lib folder of Code Blocks Portable. By now I didn't succeed in compiling wxGTK, (make gives me a code error...)

What do you think? Is this the right path?

oBFusCATed

The most robust solution for your problem is to change the configuration of C::B to use static linking as much as possible.

All other solutions will fail here or there.

Another option is to compile and install wxGTK in your home dir in the target machine.

for example: ./configure --prefix=~/cb
(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!]