From bug-octave-request at bevo dot che dot wisc dot edu Mon Oct 26 21:03:27 1998 Subject: Octave-2.1.7 with egcs-1.1b. More problems From: "John W. Eaton" To: Joao Cardoso Cc: bug-octave Date: Mon, 26 Oct 1998 21:03:18 -0600 (CST) On 27-Oct-1998, Joao Cardoso wrote: | After applying your patch, the errors gone away, but the following | warnings remained: (I am not formating the logs) | | /src/compilers/octave-2.1.7/liboctave/data-conv.cc:616: warning: passing `volatile short unsigned int *' as argument 1 of `swap_2_bytes(void *, int)' discards volatile | /src/compilers/octave-2.1.7/liboctave/data-conv.cc:620: warning: passing `volatile unsigned int *' as argument 1 of `swap_4_bytes(void *, int)' discards volatile | /src/compilers/octave-2.1.7/liboctave/data-conv.cc:628: warning: passing `volatile short int *' as argument 1 of `swap_2_bytes(void *, int)' discards volatile | /src/compilers/octave-2.1.7/liboctave/data-conv.cc:632: warning: passing `volatile int *' as argument 1 of `swap_4_bytes(void *, int)' discards volatile | /src/compilers/octave-2.1.7/liboctave/idx-vector.cc:469: warning: converting `int (*)(int *, int *)' to `int (*)(const void *, const void *)' is a contravariance violation | /src/compilers/octave-2.1.7/liboctave/pathsearch.cc:162: warning: implicit declaration of function `int kpse_path_expand(...)' | /src/compilers/octave-2.1.7/liboctave/pathsearch.cc:162: warning: initialization to `char *' from `int' lacks a cast | /src/compilers/octave-2.1.7/src/input.cc:560: warning: assuming & on `octave_value_list::length() const' | /src/compilers/octave-2.1.7/src/oct-procbuf.cc:209: warning: `symbols_of_oct_procbuf()' was declared `extern' and later `static' | /src/compilers/octave-2.1.7/src/oct-procbuf.h:64: warning: previous declaration of `symbols_of_oct_procbuf()' | /src/compilers/octave-2.1.7/src/utils.cc:107: warning: implicit declaration of function `int strncasecmp(...)' | | And finally, at the final linking stage, I got: | | c++ -I. -I/src/compilers/octave-2.1.7/src -I.. -I../liboctave -I../src \ | -I../libcruft/misc -I/src/compilers/octave-2.1.7 \ | -I/src/compilers/octave-2.1.7/liboctave \ | -I/src/compilers/octave-2.1.7/src \ | -I/src/compilers/octave-2.1.7/libcruft/misc -DHAVE_CONFIG_H -mieee-fp \ | -fno-rtti -fno-exceptions -fno-implicit-templates -O2 -L.. -fPIC -g -o \ | octave octave.o builtins.o ops.o balance.o besselj.o betainc.o \ | chol.o colloc.o dassl.o det.o eig.o expm.o fft.o fft2.o filter.o \ | find.o fsolve.o gammainc.o getgrent.o getpwent.o getrusage.o \ | givens.o hess.o ifft.o ifft2.o inv.o log.o lpsolve.o lsode.o \ | lu.o minmax.o pinv.o qr.o quad.o qzval.o rand.o schur.o sort.o \ | svd.o syl.o time.o -L../liboctave -L../libcruft -L../src \ | -loctinterp -loctave -lcruft ../readline/libreadline.a \ | ../kpathsea/libkpathsea.a -lg2c -lm -Ra,XPG4PLUS,ELF \ | -L/usr/local/lib/gcc-lib/i586-pc-sco3.2v5.0.4/egcs-2.91.57 \ | -L/usr/local/i586-pc-sco3.2v5.0.4/lib -L/usr/ccs/bin -L/usr/ccs/lib \ | -L/usr/local/lib -lm -lcrypt -lgen -lcurses -lm -lglob -lsocket | | Undefined first referenced | symbol in file | bool mx_leftdiv_conform(ComplexMatrix, Matrix)../src/liboctinterp.so | bool mx_leftdiv_conform(ComplexMatrix, ComplexMatrix)../src/liboctinterp.so | bool mx_leftdiv_conform(Matrix, ComplexMatrix)../src/liboctinterp.so | bool mx_div_conform(ComplexMatrix, Matrix)../src/liboctinterp.so | basic_string, __default_alloc_template<0, 0> >::Rep::clone(void)octave.o | bool mx_div_conform(ComplexMatrix, ComplexMatrix)../src/liboctinterp.so | bool mx_div_conform(Matrix, ComplexMatrix)../src/liboctinterp.so | bool mx_leftdiv_conform(Matrix, Matrix)../src/liboctinterp.so | bool mx_div_conform(Matrix, Matrix)../src/liboctinterp.so | octave: fatal error: Symbol referencing errors. No output written to octave | collect2: ld returned 1 exit status | | I found that `mx_leftdiv_conform' and `mx_div_conform' are | referenced/defined in src/xdiv.cc, but should't basic_string come from | libstdc++? I think the following patch should fix the mx_div_conform and mx_leftdiv_conform problem. I don't know why the string function is undefined. Yes, it should be defined by libstdc++. I don't think Octave ever explicitly calls it. It doesn't come up undefined when I compile my current sources with egcs 1.1a. Thanks, jwe Mon Oct 26 08:41:46 1998 John W. Eaton * xdiv.cc (mx_leftdiv_conform): Explicitly declare args to be passed as references to const objects. Fix explicit instantiation requests to match. (mx_div_conform): Likewise. Index: xdiv.cc =================================================================== RCS file: /home/jwe/src/master/octave/src/xdiv.cc,v retrieving revision 1.23 diff -c -r1.23 xdiv.cc *** xdiv.cc 1998/09/24 19:00:19 1.23 --- xdiv.cc 1998/10/27 02:49:45 *************** *** 53,59 **** template bool ! mx_leftdiv_conform (T1 a, T2 b) { int a_nr = a.rows (); int b_nr = b.rows (); --- 53,59 ---- template bool ! mx_leftdiv_conform (const T1& a, const T2& b) { int a_nr = a.rows (); int b_nr = b.rows (); *************** *** 70,83 **** return true; } ! template bool mx_leftdiv_conform (Matrix&, Matrix&); ! template bool mx_leftdiv_conform (Matrix&, ComplexMatrix&); ! template bool mx_leftdiv_conform (ComplexMatrix&, ComplexMatrix&); ! template bool mx_leftdiv_conform (ComplexMatrix&, Matrix&); template bool ! mx_div_conform (T1 a, T2 b) { int a_nc = a.cols (); int b_nc = b.cols (); --- 70,86 ---- return true; } ! #define INSTANTIATE_MX_LEFTDIV_CONFORM(T1, T2) \ ! template bool mx_leftdiv_conform (const T1&, const T2&) + INSTANTIATE_MX_LEFTDIV_CONFORM (Matrix, Matrix); + INSTANTIATE_MX_LEFTDIV_CONFORM (Matrix, ComplexMatrix); + INSTANTIATE_MX_LEFTDIV_CONFORM (ComplexMatrix, Matrix); + INSTANTIATE_MX_LEFTDIV_CONFORM (ComplexMatrix, ComplexMatrix); + template bool ! mx_div_conform (const T1& a, const T2& b) { int a_nc = a.cols (); int b_nc = b.cols (); *************** *** 93,103 **** return true; } ! template bool mx_div_conform (Matrix&, Matrix&); ! template bool mx_div_conform (Matrix&, ComplexMatrix&); ! template bool mx_div_conform (ComplexMatrix&, ComplexMatrix&); ! template bool mx_div_conform (ComplexMatrix&, Matrix&); // Right division functions. // --- 96,109 ---- return true; } + + #define INSTANTIATE_MX_DIV_CONFORM(T1, T2) \ + template bool mx_div_conform (const T1&, const T2&) ! INSTANTIATE_MX_DIV_CONFORM (Matrix, Matrix); ! INSTANTIATE_MX_DIV_CONFORM (Matrix, ComplexMatrix); ! INSTANTIATE_MX_DIV_CONFORM (ComplexMatrix, Matrix); ! INSTANTIATE_MX_DIV_CONFORM (ComplexMatrix, ComplexMatrix); // Right division functions. //