Mavericks で wchar.h がないと言われコンパイルできなくなった
サンプルコード
- サンプルコード
//main.cpp #include <iostream> int main(void){ return 0; }
- コンパイル結果
$ g++-mp-4.8 main.cpp In file included from /opt/local/include/gcc48/c++/bits/postypes.h:40:0, from /opt/local/include/gcc48/c++/iosfwd:40, from /opt/local/include/gcc48/c++/ios:38, from /opt/local/include/gcc48/c++/ostream:38, from /opt/local/include/gcc48/c++/iostream:39, from main.cpp:1: /opt/local/include/gcc48/c++/cwchar:44:19: fatal error: wchar.h: No such file or directory #include <wchar.h> ^ compilation terminated.
解決方法
以下を実行する
$ xcode-select --install