error while loading shared libraries

孤者浪人 提交于 2019-12-12 03:25:59

问题


I'm trying to install Code::Blocks from source. There is an `anarchy' folder on my university's CS department's mainframe, where anyone can install anything, basically.

wxwidgets is a dependency of Code::Blocks, and I'm trying to put wxGTK, as it's called, into my own folder on `anarchy', which works fine.

I then compile Code::Blocks with the correct configure flags so that it recognizes wxwidgets 2.8 during the installation. But then, when I want to run `codeblocks', it says

codeblocks: error while loading shared libraries: libwx_gtk2u-2.8.so.0

Obviously I don't have su access as I am only a student at the university. Is there a way to resolve this without su privileges? They are Debian 5.0 systems, I believe, with all dependencies but wxwidgets, so I had to build that on my own.


回答1:


This is how I solved this:

First I ran the configure script like this:

$ ./configure --prefix=/pub/anarchy/<myname>/codeblocks --with-wx-config=/pub/anarchy/<myname>/wxGTK/bin/wx-config

then:

$ export LDFLAGS="-Wl,-R /pub/anarchy/<myname>/wxGTK/lib"
$ make
$ make install

Now codeblocks finds libwx_gtk2u-2.8.so.0.

An alternative solution (untested) according to comments would be:

$ ./configure LDFLAGS="-Wl,-R /path/to/wxGTK/lib" # other configure flags omitted
$ make
$ make install


来源:https://stackoverflow.com/questions/2203946/error-while-loading-shared-libraries

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!