|
Boost Users : |
From: dz_nyc11354 (dz_nyc11354_at_[hidden])
Date: 2002-04-10 17:03:16
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<char,
string_char_traits<char>, __default_alloc_template<false, 0> > &,
basic_string<char, string_char_traits<char>,
__default_alloc_template<false, 0> > const &)test.o
ostream::operator<<(ostream &(*)(ostream &))test.o
boost::c_regex_traits<char>::init(void)test.o
endl(ostream &) test.o
boost::re_detail::c_traits_base::lower_case_map test.o
string_char_traits<char>::set(char *, char const &, unsigned
int)test.o
string_char_traits<char>::eos(void) test.o
cerr test.o
boost::bad_pattern::~bad_pattern(void)test.o
boost::regbase::regbase(void) test.o
ios::rdbuf(void) const test.o
ostream::operator<<(char const *) test.o
boost::re_detail::c_traits_base::syntax_map test.o
runtime_error virtual table test.o
boost::c_regex_traits<char>::transform_primary(basic_string<char,
string_char_traits<char>, __default_alloc_template<false, 0> > &,
basic_string<char, string_char_traits<char>,
__default_alloc_template<false, 0> > const &)test.o
boost::c_regex_traits<char>::toi(char)test.o
ostream::operator<<(unsigned int) test.o
string_char_traits<char>::copy(char *, char const *, unsigned
int)test.o
boost::re_detail::c_traits_base::do_lookup_class(char const *)test.o
boost::c_regex_traits<char>::m_free(void)test.o
boost::re_detail::c_traits_base::error_string(unsigned int)test.o
streambuf::sbumpc(void) test.o
boost::c_regex_traits<char>::update(void)test.o
boost::re_detail::c_traits_base::do_lookup_collate(basic_string<char,
string_char_traits<char>, __default_alloc_template<false, 0> > &, char
const *)test.o
cin test.o
string_char_traits<char>::length(char const *)test.o
istream::isfx(void) test.o
boost::bad_expression::bad_expression(basic_string<char,
string_char_traits<char>, __default_alloc_template<false, 0> > const
&)test.o
string_char_traits<char>::move(char *, char const *, unsigned
int)test.o
boost::c_regex_traits<char>::toi(char const *&, char const *,
int)test.o
ios::setstate(int) test.o
__out_of_range(char const *) test.o
ld: fatal: Symbol referencing errors. No output written to test
collect2: ld returned 1 exit status
*** Error code 1
make: Fatal error: Command failed for target `test'
*********************************************************
Just a note, I don't have any errors when I test tokenizer
ex:
***************************************
#include <boost/regex.hpp>
#include <iostream>
#include <boost/tokenizer.hpp>
int main(){
using namespace std;
using namespace boost;
string s = "Field 1,\"putting quotes around fields, allows
commas\",Field 3";
tokenizer<escaped_list_separator<char> > tok(s);
for(tokenizer<escaped_list_separator<char> >::iterator
beg=tok.begin(); beg!=tok.end();++beg){
cout << *beg << "\n";
}
}
****************************************
however, it works with g++ only and not gcc. :/
- thank for any info.
- David
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