Author Topic: C::B Portable: libcodeblocks.so.0 error  (Read 5914 times)

Offline Gublerian

  • Single posting newcomer
  • *
  • Posts: 2
C::B Portable: libcodeblocks.so.0 error
« on: March 15, 2010, 12:50:17 pm »
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:
Code
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.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: C::B Portable: libcodeblocks.so.0 error
« Reply #1 on: March 15, 2010, 08:33:06 pm »
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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: C::B Portable: libcodeblocks.so.0 error
« Reply #2 on: March 15, 2010, 09:23:28 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.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: C::B Portable: libcodeblocks.so.0 error
« Reply #3 on: March 16, 2010, 06:45:19 am »
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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Gublerian

  • Single posting newcomer
  • *
  • Posts: 2
Re: C::B Portable: libcodeblocks.so.0 error
« Reply #4 on: March 18, 2010, 02:21:03 pm »
Quote
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.
Thanks for your quick reply. This works!

Now I have the next error:
Quote
error 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?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: C::B Portable: libcodeblocks.so.0 error
« Reply #5 on: March 18, 2010, 03:43:38 pm »
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!]