Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: wlsglj on November 12, 2011, 01:34:08 pm

Title: can not link the share library
Post by: wlsglj on November 12, 2011, 01:34:08 pm
An error appear when I run my project as follow:
error while loading share libraries:libG4Tree.so:cannot open object file:No such file or directory
my system is Ubuntu 10.04.I use the .brash to set my environment as follow :
export LD_LIBRARY_PATH=/home/CLHEP/lib:/home/geant4/geant4.9.4.p01/lib/Linux-g++
the library file libG4Tree.so is in the second file.where is wrong?

Title: Re: can not link the share library
Post by: MortenMacFly on November 12, 2011, 04:19:51 pm
An error appear when I run my project as follow:
error while loading share libraries:libG4Tree.so:cannot open object file:No such file or directory
my system is Ubuntu 10.04.I use the .brash to set my environment as follow :
export LD_LIBRARY_PATH=/home/CLHEP/lib:/home/geant4/geant4.9.4.p01/lib/Linux-g++
the library file libG4Tree.so is in the second file.where is wrong?
Hmmm, I fail to see how this is related to Code::Blocks so you are probably in the wrong forum. We are talking about Code::Blocks development here, which you read and agreed to when you signed with the forums.

However, what happens if you try on a command prompt? What, if libG4Tree itself fails to resolve its dependencies? That would be my interpretation of the message. So find out what this library belong to and what it needs. The nm tool, alternatively the symbol browser plugin of C::B  can be of help.

Probably you should ask in a forum that knows about "geant" (What is it???)

BTW: I would also recommend you alsways do this:
Code
export LD_LIBRARY_PATH=/home/CLHEP/lib:/home/geant4/geant4.9.4.p01/lib/Linux-g++:$LD_LIBRARY_PATH
...to keep any previously setup folders.
Title: Re: can not link the share library
Post by: Radek on November 14, 2011, 04:46:42 pm
Don't "export", leave the system libpath be unless you have a serious reason to change it. Add the library to the linked libraries in Project -> Build Options -> Linker Settings. Try compiling again.
Title: Re: can not link the share library
Post by: Jenna on November 14, 2011, 07:36:09 pm
Don't "export", leave the system libpath be unless you have a serious reason to change it. Add the library to the linked libraries in Project -> Build Options -> Linker Settings. Try compiling again.
The export variable is only valid for the shell you are currently in, so it does normall not do any harm to the system.