![](/img/trans.png)
[英]How can I continue working on OpenGL with macOS Catalina 10.15.4?
[英]How can I solve this error on macOS catalina?
我正在嘗試使用 g++ 編譯器編譯 Cpp 程序,但出現此錯誤:
Yuliam-MBP:Documents yuliamosh$ g++-9 -std=c++17 -Wall -Wextra -pedantic vector.cpp -o vector
In file included from /usr/local/Cellar/gcc/9.2.0_3/include/c++/9.2.0/bits/postypes.h:40,
from /usr/local/Cellar/gcc/9.2.0_3/include/c++/9.2.0/iosfwd:40,
from /usr/local/Cellar/gcc/9.2.0_3/include/c++/9.2.0/ios:38,
from /usr/local/Cellar/gcc/9.2.0_3/include/c++/9.2.0/ostream:3,
from /usr/local/Cellar/gcc/9.2.0_3/include/c++/9.2.0/iostream:39,
from vector.cpp:1:
/usr/local/Cellar/gcc/9.2.0_3/include/c++/9.2.0/cwchar:44:10: fatal error: wchar.h: No such file or directory
44 | #include <wchar.h>
| ^~~~~~~~~
compilation terminated.
安裝xcode-select --install
然后切換到新安裝的工具sudo xcode-select --switch /Library/Developer/CommandLineTools/
您可能需要重置編譯工具的默認位置:
xcode-select --reset
這些是通常的修復。 可悲的是,他們都沒有為我工作!
這對我有用: 自制解決方案
似乎沒有找到“wchar.h”。
我建議按照此線程中的說明進行操作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.