Ulrich,
That's where things get a little strange. The source module is only 44
lines line, and line 25 is a blank line. :( Here's the entire module:
- - - - - - - - - - - - - - - - - - - - - - - -
// -*- c++ -*-
#include <sigc++/signal_system.h>
#include <sigc++/retbind.h>
#include <iostream>
#include <string>
/*
Copyright 1999, Karl Nelson
This program shows how to alter the return type of a slot
to match a signal using retbind().
*/
#ifdef SIGC_CXX_NAMESPACES
using namespace std;
using namespace SigC;
#endif
int foo1(int i)
{
return i;
}
int main(int argc,char **argv)
{
cout << ">> Sizes "<<endl;
cout << "sizeof(Slot1<void,int>) = "
<< sizeof(Slot1<void,int>)<<endl;
cout << "sizeof(Slot1_<void,int>) = "
<< sizeof(SlotData)<<endl;
cout << ">> Connecting Slots"<<endl;
Slot1<string,int> slot1=retbind<string>(slot(foo1), string("Hello"));
Slot1<float,int> slot2=retbind<float>(slot(foo1), 9.5);
cout << ">> Calling Slots"<<endl;
cout << "Slot1: " << slot1.call(1) << endl;
cout << "Slot2: " << slot2.call(1) << endl;
return 0; // compiling is passing
}
- - - - - - - - - - - - - - - - - - - - - - - -
I had the same problem happen with a different package, gtkmm, but that
doesn't even report a line number, just a module and a function(s):
# make
/bin/sh ../../libtool --mode=link c++ -o gtkmmproc parser.o gtkmmproc.o
lexer.o fixate.o
c++ -o gtkmmproc parser.o gtkmmproc.o lexer.o fixate.o
gtkmmproc.o: In function `OutputChannel::OutputChannel(void)':
gtkmmproc.o(.text+0x5de4): the use of `tempnam' is dangerous, better use
`mkstemp'
parser.o: In function `ostream & operator<<<char, string_char_traits<char>,
__default_alloc_template
<true, 0> >(ostream &, basic_string<char, string_char_traits<char>,
__default_alloc_template<true, 0
> > const &)':
parser.o(.gnu.linkonce.t.__ls__H3ZcZt18string_char_traits1ZcZt24__default_al
loc_template2b1i0_R7ostr
eamRCt12basic_string3ZX01ZX11ZX21_R7ostream+0x10): undefined reference to
`ostream::write(char const
*, long)'
collect2: ld returned 1 exit status
make: *** [gtkmmproc] Error 1
Mark Post
-----Original Message-----
From: Ulrich Weigand [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 03, 2002 4:36 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: Compilation (link) failure for libsigc++ package
Mark Post wrote:
>/tmp/build-libsigc-1.0.4-s390-1/libsigc++-1.0.4/tests/signals/retbind_slot_
t
>est.cc:25: undefined reference to `ostream::write(char const *, long)'
Could you check the source code at the given line? I assume the
problem is that the second argument to ostream::write is supposed
to be of type 'streamsize' (which is typedef'd to 'ptrdiff_t', which
is equivalent to 'int' on s390), not 'long'.
'int' and 'long', while showing equivalent behaviour on s390, are
different types after all, and cause in particular different name
mangling when they occur as function argument, so that the function
won't be found by the linker.
Bye,
Ulrich
--
Dr. Ulrich Weigand
[EMAIL PROTECTED]