のねのBlog

パソコンの問題や、ソフトウェアの開発で起きた問題など書いていきます。よろしくお願いします^^。

GNU getopt

Command line options parser for Win32: getopt()

プロトタイプを書き換える。
# ifdef __GNU_LIBRARY__
/* Many other libraries have conflicting prototypes for getopt, with
differences in the consts, in stdlib.h. To avoid compilation
errors, only prototype getopt for the GNU C library. */
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts);
# else /* not __GNU_LIBRARY__ */
//extern int getopt ();
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts);
# endif /* __GNU_LIBRARY__ */

    • __STDC__

ANSI C 標準に完全に準拠していることを示します。
/Za (言語拡張機能の無効化) コンパイラ オプションを指定していて、C++ コードはコンパイルしない場合にのみ、整定数 1 として定義されます。それ以外の場合は定義されません。
定義済みマクロ

string.hのためだと思う
オーバーロードされた関数 'memcpy' の C リンケージの 2 回以上の宣言は許されません。