?????????????????????????????????????????·????????????????????????£?
????boost??????????????????(boost_1_34_1/more/getting_started/unix-variants.html ??6??)
QUOTE:
A.
You can specify the full path to each library:
$ c++ -I path/to/boost_1_34_1 example.cpp -o example "
~/boost/lib/libboost_regex-gcc34-mt-d-1_34.a
QUOTE:
B.
You can separately specify a directory to search (with -Ldirectory) and a library name to search for (with -llibrary??2 dropping the filename's leading lib and trailing suffix (.a in this case):
$ c++ -I path/to/boost_1_34_1 example.cpp -o example "
-L~/boost/lib/ -lboost_regex-gcc34-mt-d-1_34
???????????? .so ????????? makefile???
CXXFLAGS        =  -lgcc_s $(LIB) -lboost_regex-gcc-d-1_37
COMPILE.C        = $(CC) -c $(INCLUDE)
MAKEEXE            = $(CC) $(CXXFLAGS)
#????????????????.o ??????.o????????????????????£????????·??????../pub/b.o
OBJ            = regex_match_example.o
EXE            = winner
all:            $(EXE)
$(EXE):            ${OBJ}
#'$^'??'$@' ????“???????”??Automatic Variables?????????VPATH????????????????????
$(MAKEEXE) $^ -o $@
%.o:            %.cpp
$(COMPILE.C) $^ -o $@
clean:
rm -f *.o $(EXE) core
????????????????????????????????£??????????????????????
????????????????????
????./winner: error while loading shared libraries: libboost_regex-gcc-d-1_37.so: cannot open shared object file: No such file or directory
????????3???????ú???????汾????????????
?????? ldd ????????????????????? file ??????????汾???
????[fancp@s12084 test]$ ldd winner
????/lib/libcwait.so (0x00de9000)
????libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00db1000)
????libboost_regex-gcc-d-1_37.so => not found
????libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x00340000)
????libm.so.6 => /lib/tls/libm.so.6 (0x00b51000)
????libc.so.6 => /lib/tls/libc.so.6 (0x00a23000)
????/lib/ld-linux.so.2 (0x00a04000)
????[fancp@s12084 test]$ file libboost_regex-gcc-d-1_37.so
????libboost_regex-gcc-d-1_37.so: ELF 32-bit LSB shared object?? Intel 80386?? version 1 (SYSV)?? not stripped
????[fancp@s12084 test]$
??????????£??????????????? LIB ?????????????????·????
??????? .bash_profile ??????? LIB ????????e???????????棬??? shell ???????????OK??