0

I'm compiling an openFrameworks project with ofxTrueTypeFont on Code::Blocks 13.12 on Windows 8.1, with mingw32-g++ version 4.8.1.

It ends up with an error:

...\ofxTrueTypeFontUC.cpp | fatal error: codecvt: No such file or directory

I even turned on -std=c++11 in the compiler flags. Here's someone with a similar question, who obviously hasn't figured out a workaround yet.

How should I make this compile? Meanwhile I'll try updating mingw32-g++...

EDIT:

Seems that 4.8.1 is the latest version... even though there's gcc-5.0.0 out there.

Community
  • 1
  • 1
hello all
  • 252
  • 2
  • 17
  • try tdm-gcc http://tdm-gcc.tdragon.net/download – Jichao Feb 14 '15 at 14:00
  • I have v4.9.2rev3 on Windows. It still does NOT have codecvt. In fact, the header doesn't even exist. In the old versions it used to at least exist but didn't work. At most you'll find `codecvt.h` but that's an internal gcc header and it says do not include it directly. Even if you do, none of the functions such as `std::wstring_convert` exist. You're out of luck on Windows as always. You'll have to use MSVC. MSVC also contains `filesystem` which is a nice thing to have. Other than those two, I use GCC. – Brandon Feb 14 '15 at 19:32
  • 1
    @Brandon I guess I'll just go with MSVC... – hello all Feb 15 '15 at 07:35
  • mingw-w64 is at 4.9.2 (at least) , the old mingw32 is not maintained properly – M.M Feb 17 '15 at 01:47

1 Answers1

2

Not really an answer, but welcome to real life. In theory, there should be one single C++ reference, with versions (C+11, C+14, ...) and all compilers should follow that, allowing everything specified and disallowing everything else.

In real world, compiler can reject constructs allowed by the spec and accept others that the spec would disallow. MSVC before 2010 was known to be very reluctant to standard, gcc is known to allow plenty of extensions, and it looks like you found a place where it not fully implements C++11 spec.

You can either try another compiler that would accept your input code, or do what older C programmers used to do in last century : find what should be the correct include files for your developpement environment. Maybe #include <locale> could be enough ...

BTW, the problem in not exactly in compiler part, but on standard library implementation ...

Serge Ballesta
  • 143,923
  • 11
  • 122
  • 252