Category : libstdc++

Consider this simple program: #include <iostream> #include <locale> int namespace std { std::locale::global(std::locale("en_US.UTF-8")); // 1 std::wcout.imbue(std::locale("en_US.UTF-8")); // 2 std::wcout << L"én"; } If I build and run this on a Linux machine with either gcc or clang, using either libc++ or libstdc++, this program prints the expected accented character. If I comment out both line ..

Read more

I’m trying to compile memcached and I get this error. I’m using clang and lld and linking C++ std lib statically using -l:libc++.a. ld.lld: error: undefined symbol: std::__throw_length_error(char const*) >>> referenced by stl_vector.h:1759 (/usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stl_vector.h:1759) Is this a discreppancy between the system headers and the implementation from libc++.a? Source: Windows Que..

Read more

Now that GCC 11, which supports the new calendar and time zone features is released, I am trying to use these in my code. With the following minimal example: #include <chrono> #include <iostream> int main() { using namespace std; cout << chrono::utc_clock::now() << endl; return EXIT_SUCCESS; } compiled using the following: > /usr/local/gcc-11.1.0/bin/g++-11.1 -std=c++-20 main.cpp ..

Read more

I’m using GNU Arm Embedded Toolchain 10-2020-q4-major (arm-none-eabi-* 10.2.1) and I would like to take advantage of modern c++ features. So I’m trying to find out which c++ features (language core features as well as libstdc++ features) are available with this particular toolchain. I read through this matrix https://gcc.gnu.org/projects/cxx-status.html, and they don’t seem to distinguish ..

Read more

I have an unusual case of the error in the title, where std::assert gives the error but assert() from assert.h gives no error. This is g++ and the GNU libstdc++. void HealthMembership::calculateCharges(void) { float fee; std::assert(this->fee_type); fee = this->in_months * this->fee_rates[this->fee_type]; std::cout << std::fixed << std::showpoint << std::setprecision(2); std::cout << "The total charges are $" ..

Read more