Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
opterrが0に設定されている場合、識別子opterrとoptargが未定義であるため、エラーが発生するCのプログラムで作業しています。そのファイルに#includeがないことに気付きました。それは考えられる唯一の理由でしょうか?
エラー
エラー:識別子「opterr」は未定義です
opterr = 0;
エラー:識別子「optarg」は未定義です
ほとんどの場合、あなたが行方不明です:
#include <unistd.h>
getopt などが定義されている場所です。