Boost logo

Boost Users :

Subject: [Boost-users] Boost regex library problem on Mac
From: Michael Muratet (mmuratet_at_[hidden])
Date: 2011-01-29 17:10:17


Greetings

I am using some simple boost regex code:

const boost::regex eparse("^([[:digit:]]+).*"); (in a header file)
boost::cmatch matches; (in a cpp file)

from the subroutine
        if (boost::regex_match(edit.c_str(), matches, eparse)) {
                 // matches[0] contains the original string. matches[n]
                 // contains a sub_match object for each matching
                 // subexpression
                 for (int i = 1; i < matches.size(); i++) {
                        // sub_match::first and sub_match::second are iterators that
                        // refer to the first and one past the last chars of the
                        // matching subexpression
                        std::string match(matches[i].first, matches[i].second);
                        std::cout << "\tmatches[" << i << "] = " << match << std::endl;
                 }
        }

with a makefile:

CXXFLAGS = -O2 -g -Wall -fmessage-length=0 -I/usr/local/boost_1_39_0

OBJS = CrossMapper.o CrossMap.o Read.o Target.o

LIBS = -L/lib -lboost_regex-xgcc40-mt-1_39

INCLUDE= /usr/local/boost_1_39_0

TARGET = CrossMapper

$(TARGET): $(OBJS)
        $(CXX) -o $(TARGET) $(OBJS) $(LIBS)

all: $(TARGET)

clean:
        rm -f $(OBJS) $(TARGET)

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?

Thanks

Mike


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