Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Can I build a wchar_t version using libstdc++ Version 2?

build libstdc++ version
0
Posted

Can I build a wchar_t version using libstdc++ Version 2?

0

Yes you can, but first let us explain the problem. libstdc++ version 2 is an old c++ library that came bundled with GCC 2.9x. It pre-dates the C++ standard and is therefore not conforming. It is no longer actively maintained as it has been superseded by libstdc++ version 3 which comes bundled with GCC 3. libstdc++ does not have a typedef for std::wstring. It seems the reason for this is a bug in basic_string::c_str() which attempts to return the constant value “” for an empty string. This will not compile when T is anything other than char. OpenTop avoids using the c_str() method, but there is one place where we just have to use it. However, to enable OpenTop to compile with libstdc++ v2, we have some conditional code to by-pass the problem area. The conditional code is invoked when the OT_BROKEN_C_STR macro is #defined. So, to build a wide char version using GCC 2.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123