From help-request at octave dot org Fri Feb 18 14:17:54 2005 Subject: Re: problem compiling 2.1.65 on solaris From: "John W. Eaton" To: "Dmitri A. Sergatskov" Cc: "John W. Eaton" , octave help mailing list Date: Fri, 18 Feb 2005 15:23:15 -0500 On 18-Feb-2005, Dmitri A. Sergatskov wrote: | John W. Eaton wrote: | ... | > | > Please try the following patch and let me know whether it works | > correctly. | | Still some problems: | | g++ -c -fPIC -I. -I.. -I../liboctave -I../src -I../libcruft/misc -I../glob -I../glob -DHAVE_CONFIG_H -Wall -W -Wshadow -O2 -mcpu=ultrasparc -mtune=ultrasparc -pipe | file-ops.cc -o pic/file-ops.o | file-ops.cc: In static member function `static std::string file_ops::canonicalize_file_name(const std::string&, std::string&)': | file-ops.cc:358: error: passing `const std::string' as `this' argument of `std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT, _Traits, | _Alloc>::operator=(const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits, _Alloc = std::allocator]' discards qualifiers | file-ops.cc:368: error: cannot convert `const std::basic_string, std::allocator >' to `const char*' for argument `1' to `int | resolvepath(const char*, char*, size_t)' | file-ops.cc:373: warning: comparison between signed and unsigned integer expressions | make: *** [pic/file-ops.o] Error 1 OK, please try this patch in addition to the first. It won't fix the last warning, but I think it will compile now. jwe liboctave/ChangeLog: 2005-02-18 John W. Eaton * file-ops.cc (file_ops::canonicalize_file_name) [HAVE_RESOLVEPATH]: Save value returned from octave_env::make_absolute in local var. Pass const char*, not std::string as first arg of resolvepath. Index: liboctave/file-ops.cc =================================================================== RCS file: /usr/local/cvsroot/octave/liboctave/file-ops.cc,v retrieving revision 1.36.2.2 diff -u -r1.36.2.2 file-ops.cc --- liboctave/file-ops.cc 9 Feb 2005 23:11:11 -0000 1.36.2.2 +++ liboctave/file-ops.cc 18 Feb 2005 20:14:18 -0000 at @ -355,9 +355,10 @@ // relative names into absolute ones, so prepend the working // directory if the path is not absolute. - name = octave_env::make_absolute (name); + std::string absolute_name + = octave_env::make_absolute (name, octave_env::getcwd ()); - size_t resolved_size = name.length (); + size_t resolved_size = absolute_name.length (); while (1) { at @ -365,7 +366,8 @@ OCTAVE_LOCAL_BUFFER (char, resolved, resolved_size); - resolved_len = ::resolvepath (name, resolved, resolved_size); + int resolved_len = ::resolvepath (absolute_name.c_str (), resolved, + resolved_size); if (resolved_len < 0) break; ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------