Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost regex library problem on Mac
From: Anthony Foiani (tkil_at_[hidden])
Date: 2011-01-29 20:52:51


Mike, greetings --

Michael Muratet <mmuratet_at_[hidden]> writes:

> if (boost::regex_match(edit.c_str(), matches, eparse)) {

As an aside, is 'edit' a std::string? regex_match should be able to
deal with that directly, no need for c_str().

> It links but will not load:
>
> Macintosh-8:~/Documents/workspace/CrossMapper mmuratet$ ./CrossMapper
> dyld: Library not loaded: libboost_regex-xgcc40-mt-1_39.dylib
> Referenced from: /Users/mmuratet/Documents/workspace/CrossMapper/./
> CrossMapper
> Reason: image not found
> Trace/BPT trap
> Macintosh-8:~/Documents/workspace/CrossMapper mmuratet$
>
> I've been chasing this for several hours and can't get anywhere. Can
> anyone offer any suggestions?

Is /lib in your runtime library search path? On linux, that's
LD_LIBRARY_PATH. Looks like it's DYLD_LIBRARY_PATH on OSX.

You might also be able to use rpath in the link step, where the link
stores the path to the library as found at link time, instead of
having dyld search for it at runtime. I think you want:

  -Wl,-rpath

On the g++ command line.

Good luck!

Tony


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net