Greetings. When I try to compile the latest version cloned from Git I get the following error: add.cpp: In member function ‘void GiNaC::add::print_add_sorted(const GiNaC::print_context&, const char*, const char*, const char*, unsigned int) const’: add.cpp:176:66: error: ‘std::ostream’ {aka ‘class std::basic_ostream<char>’} has no member named ‘str’ sorted_seq.emplace((std::ostringstream{} << sortex << it.rest).str(), it); I had been using the precompiled version that was included in OpenSuSE. Do I need to upgrade my installation? Best regards, Marko Riedel
Hi Marko, On 3/22/26 12:04 PM, Marko Riedel wrote:
When I try to compile the latest version cloned from Git I get the following error:
add.cpp: In member function ‘void GiNaC::add::print_add_sorted(const GiNaC::print_context&, const char*, const char*, const char*, unsigned int) const’: add.cpp:176:66: error: ‘std::ostream’ {aka ‘class std::basic_ostream<char>’} has no member named ‘str’ sorted_seq.emplace((std::ostringstream{} << sortex << it.rest).str(), it);
Interesting. The class ‘std::ostream’ indeed has no member named ‘str’, but its derived class ‘std::ostringstream’ does. See: <https://en.cppreference.com/w/cpp/io/basic_ostringstream.html> What's your compiler version, please? -richy. -- Richard B. Kreckel <https://in.terlu.de/~kreckel/>
I have this output from the compiler, thanks for looking into it: c++ -v Using built-in specs. COLLECT_GCC=c++ COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-suse-linux/7/lto-wrapper OFFLOAD_TARGET_NAMES=hsa:nvptx-none Target: x86_64-suse-linux Configured with: ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-languages=c,c++,objc,fortran,obj-c++,ada,go --enable-offload-targets=hsa,nvptx-none=/usr/nvptx-none, --without-cuda-driver --enable-checking=release --disable-werror --with-gxx-include-dir=/usr/include/c++/7 --enable-ssp --disable-libssp --disable-libvtv --disable-libcc1 --disable-plugin --with-bugurl=https://bugs.opensuse.org/ --with-pkgversion='SUSE Linux' --with-slibdir=/lib64 --with-system-zlib --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --enable-version-specific-runtime-libs --with-gcc-major-version-only --enable-linker-build-id --enable-linux-futex --enable-gnu-indirect-function --program-suffix=-7 --without-system-libunwind --enable-multilib --with-arch-32=x86-64 --with-tune=generic --build=x86_64-suse-linux --host=x86_64-suse-linux Thread model: posix gcc version 7.5.0 (SUSE Linux) Also an example would be helpful in the tutorial how to add custom classes to the parser using get_default_reader. There is a message on this in the MBOX archive of the list. Maybe it could be updated for inclusion in the tutorial and verified that it is a functional strategy in conjunction with memory management and the GC. Marko Am 22.03.26 um 13:55 schrieb Richard B. Kreckel:
Hi Marko,
On 3/22/26 12:04 PM, Marko Riedel wrote:
When I try to compile the latest version cloned from Git I get the following error:
add.cpp: In member function ‘void GiNaC::add::print_add_sorted(const GiNaC::print_context&, const char*, const char*, const char*, unsigned int) const’: add.cpp:176:66: error: ‘std::ostream’ {aka ‘class std::basic_ostream<char>’} has no member named ‘str’ sorted_seq.emplace((std::ostringstream{} << sortex << it.rest).str(), it);
Interesting. The class ‘std::ostream’ indeed has no member named ‘str’, but its derived class ‘std::ostringstream’ does. See: <https://en.cppreference.com/w/cpp/io/basic_ostringstream.html>
What's your compiler version, please?
-richy.
Hi Marko, On 3/22/26 9:56 PM, Marko Riedel wrote:
[...] a> gcc version 7.5.0 (SUSE Linux)
Does this old compiler get confused by the the 'streaming into temporary' idiom? I suggest you upgrade to a more recent gcc.
Also an example would be helpful in the tutorial how to add custom classes to the parser using get_default_reader. There is a message on this in the MBOX archive of the list. Maybe it could be updated for inclusion in the tutorial and verified that it is a functional strategy in conjunction with memory management and the GC.
Patches are welcome, even to the manual! -richy. -- Richard B. Kreckel <https://in.terlu.de/~kreckel/>
participants (2)
-
Marko Riedel
-
Richard B. Kreckel