Author Topic: can not link the share library  (Read 4370 times)

Offline wlsglj

  • Single posting newcomer
  • *
  • Posts: 6
can not link the share library
« 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?


Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9606
Re: can not link the share library
« Reply #1 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: [Select]
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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline Radek

  • Multiple posting newcomer
  • *
  • Posts: 104
Re: can not link the share library
« Reply #2 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.

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: can not link the share library
« Reply #3 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.