This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Library not loaded

On Tue, 2007-10-16 07:47:51 -0700, Denis Tkachov <> wrote:
> I am having problem starting my application that is successfully built. I am
> using boost to serialize/deserialize data. I have link boost library and my
> project is built successfully, but I cannot run it.

This is most probably not a problem with GCC itself, but with using it
(and the linker), so your question would be better handled at

> Running the project (build&go in xcode) I receive this error:
> dyld: Library not loaded: stage/lib/libboost_serialization-1_34_1.dylib
>   Referenced from:
> /Users/dtsachov/dev/evdp/temp/TestSerialization/build/Debug/TestSerialization
>   Reason: image not found
> Note - that is not a problem with boost, that is some problem with linking
> to the library in runtime. I had the same problem with my 2 projects, one
> uses another - one is a command line tool and another is a library. If the
> library is dynamic library I am able to build the project but unable to run
> it, getting the same error. When I made my library static as library (not
> dynamic) I can run the application.

Some additional hints were somewhat useful, like

  * Which compiler and linker is used? For which platform? MacOS I
  * How does the final linker call look like?
  * How does your dynamic linker configuration look like?
    Specifically: Is your libboost_serialization-1_34_1 in the
    library search path?

> So I suggest this is some problem of locating the library in runtime.

Most probably.

> Does anybody have an idea ?

You need to tell the dynamic linker where to actually find the
libraries. "stage/lib/..." looks like a relative path, but to what


      Jan-Benedict Glaw              +49-172-7608481
Signature of:                 Friends are relatives you make for yourself.
the second  :

Attachment: signature.asc
Description: Digital signature

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]