This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

not instantiating runtime_error objects?


Hello all,

I have a rather large application running on different systems,
one of them is a red hat linux 2.032 /w

Reading specs from /usr/local/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.91.53/specs
gcc version egcs-2.91.53 19980803 (gcc2 ss-980609 experimental)

Now, this application runs fine, also on other compilers on
other machines.

I am now porting it on a solaris machine,
SunOS olymp 5.5 Generic sun4m sparc SUNW,SPARCstation-20

Reading specs from
/sw/local_o/egcs/lib/gcc-lib/sparc-sun-solaris2.5/egcs-2.91.53/specs
gcc version egcs-2.91.53 19980803 (gcc2 ss-980609 experimental)

as you can see, using the very same compiler.


The bug I am experiencing happens at link time:
my application uses different user exceptions, defined 
as follows:

class data_sink_error : public runtime_error {
public:
  data_sink_error (const string& what_string)
    : runtime_error(what_string) {}
};

When linking on the sunos machine, I get an unresolved
external:

g++ -g -I. -D__SUNOS__ -D__sunos__ -D__OSVERSION__=5 -D__EXTENSIONS__
-D_PTHREADS -DTARGET_IPPUMP -DTARGET_IPRECV  -DRTSPPUMP
-I/sw/local_o/egcs/include -I/usr/local/include
-I/home/moar/omniORB_2.5.0/include   {whole bunch of objects} -o ippump
-L./ -L/sw/local_o/egcs/lib -L/home/moar/omniORB_2.5.0/lib/sun4_sosV_5.5
-lomnithread -lpthread -lnsl -lsocket -lposix4

Undefined			first referenced
 symbol  			    in file
runtime_error::runtime_error(basic_string<char, string_char_traits<char>,
__default_alloc_template<1, 0> > const &)TcpIpSinkThread.o
ld: fatal: Symbol referencing errors. No output written to ippump
collect2: ld returned 1 exit status
make: *** [ippump] Error 1


Now, I was trying to reduce everything to a small example
doing the same constructs, but the small example always
works. I do a nm on the object file, c++filt on it,
see that there is no such function in the object file, but
when I link it using g++, the corresponding function
seems to get generated. Am I correct on this?

So I am rather puzzled here, as to where to start to look.

Any hints?

Christoph.

--
Christoph Moar (christoph.moar@mchp.siemens.de)  Tel. (++49) 89 636-44628
SIEMENS AG Corporate Technology                  Fax. (++49) 89 636-47457
Information and Media Technology
Office Adress:  SIEMENS AG  ZT IK 1,  Otto-Hahn-Ring  6,  D-81739  Munich
Postal Adress:  SIEMENS AG  ZT IK 1,  D-81730 Munich
pgpkey http://pgp5.ai.mit.edu:11371/pks/lookup?op=index&search=0xae81b9cc


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]