I think I'm not linking the boost libary. But I checked many times
and can't find any error.
The test file I'm using is John Maddock's regex_split_example_1.cpp.
I just renamed it to test.cpp, I also have a Makefile that look like
this:
***************************************************
CC = gcc
MY_DIR = /home/dzhou/boost_1_27_0
MY_LIB = -L$(MY_DIR)/libs/regex/build/gcc
MY_INCLUDE = -I$(MY_DIR)
CFLAGS = -g -v -D_REENTRANT -Wall $(MY_INCLUDE)
LIBS = $(MY_LIB)/libboost_regex.a
LIBS_RPC = -lnsl
RANLIB = ranlib
RPCGEN_OPTS = -C
.cc.o:
$(CC) $(CFLAGS) -c $<
PROGS = test
all: ${PROGS}
test: test.o
${CC} ${CFLAGS} -o test test.o ${LIBS}
****************************************************
I've build the libary with make -f gcc.mak and it made the gcc dir
I've tryed to play around with gcc.mak by changing g++ to gcc
because I was getting errors with g++ also.
#complier:
CXX=gcc
LINKER=gcc -shared
here is the error that I'm getting:
***********************************************************
gcc -g -v -D_REENTRANT -Wall -I/home/dzhou/boost_1_27_0 -c test.cc
Reading specs from
/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.3/specs
gcc version 2.95.3 20010315 (release)
/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.3/cpp0 -lang-c++ -v
-I/home/dzhou/boost_1_27_0 -D__GNUC__=2 -D__GNUG__=2
-D__GNUC_MINOR__=95 -D__cplusplus -Dsparc -Dsun -Dunix -D__svr4__
-D__SVR4 -D__sparc__ -D__sun__ -D__unix__ -D__svr4__ -D__SVR4
-D__sparc -D__sun -D__unix -Asystem(unix) -Asystem(svr4)
-D__EXCEPTIONS -g -Wall -D__GCC_NEW_VARARGS__ -Acpu(sparc)
-Amachine(sparc) -D_REENTRANT test.cc /var/tmp/ccmuQP2y.ii
GNU CPP version 2.95.3 20010315 (release) (sparc)
#include "..." search starts here:
#include <...> search starts here:
/home/dzhou/boost_1_27_0
/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.3/../../../../include/g++-3
/usr/local/include
/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.3/../../../../sparc-sun-solaris2.7/include
/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.3/include
/usr/include
End of search list.
The following default directories have been omitted from the search
path:
End of omitted list.
/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.3/cc1plus
/var/tmp/ccmuQP2y.ii -quiet -dumpbase test.cc -g -Wall -version -o
/var/tmp/ccW67QRe.s
GNU C++ version 2.95.3 20010315 (release) (sparc-sun-solaris2.7)
compiled by GNU C version 2.95.2 19991024 (release).
/usr/ccs/bin/as -V -Qy -s -o test.o /var/tmp/ccW67QRe.s
/usr/ccs/bin/as: WorkShop Compilers 5.0 98/12/21
gcc -g -v -D_REENTRANT -Wall -I/home/dzhou/boost_1_27_0 -o test
test.o
-L/home/dzhou/boost_1_27_0/libs/regex/build/gcc/libboost_regex.a
Reading specs from
/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.3/specs
gcc version 2.95.3 20010315 (release)
/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.3/collect2 -V -Y
P,/usr/ccs/lib:/usr/lib -Qy -o test
/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.3/crt1.o
/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.3/crti.o
/usr/ccs/lib/values-Xa.o
/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.3/crtbegin.o
-L/home/dzhou/boost_1_27_0/libs/regex/build/gcc/libboost_regex.a
-L/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.3 -L/usr/ccs/bin
-L/usr/ccs/lib -L/usr/local/lib test.o -lgcc -lc -lgcc
/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.3/crtend.o
/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.3/crtn.o
ld: Software Generation Utilities - Solaris-ELF (4.0)
Undefined first referenced
symbol in file
boost::bad_expression::~bad_expression(void)test.o
boost::re_detail::c_traits_base::class_map test.o
cout test.o
string_char_traits<char>::assign(char &, char const &)test.o
ostream::write(char const *, int) test.o
string_char_traits<char>::compare(char const *, char const *, unsigned
int)test.o
boost::bad_pattern virtual table test.o
__length_error(char const *) test.o
boost::bad_expression virtual table test.o
istream::ipfx1(void) test.o
boost::c_regex_traits<char>::transform(basic_string