cygwin の SDL 関連パッケージ

あと cygwin で libpng とか libz とか freetype を -mno-cygwin でビルドしていたら眠くなったのでパッケージが無いか探したら有り難いことに作って下さっている方がいたので使わせてもらうことにした。
http://cefiro.homelinux.org/topics/SDL/setup-win32-cygwin-bin.html

各ライブラリはすべて

/usr/bin/mingw
/usr/lib/mingw
/usr/include/mingw

等の下にインストールされます.必要に応じてコマンド検索パスを設定してください.

http://cefiro.homelinux.org/topics/SDL/setup-win32-cygwin-bin.html

て書いてあるんだけど、DLLは /usr/lib/bin の中に入るようです。←SDL関連のDLLだけだった。libpngとかその他必要なDLLがどこにインストールされたのかわからない。

パッケージの中みたらSDL_*とsmpeg以外はDLLが入ってなかった。SDL_image.dll が cygwin の libz や libpng や jpeg の dll をリンクしようとしてうまく動いていないような気配。プログラムが悪い可能性もあるけど。

-mno-cygwinでC++のコードをビルドするときは -I/usr/include してはいけない

今日SDLを使ったC++で書かれたゲームのコンパイルをしようとしていたら、wchar関連のエラーが出てコンパイルできないということがあった。

/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:146: error: `::fgetwc' has not been declared
/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:147: error: `::fgetws' has not been declared
/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:148: error: `::fputwc' has not been declared
/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:149: error: `::fputws' has not been declared
/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:150: error: `::fwide' has not been declared
/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:151: error: `::fwprintf' has not been declared
/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:152: error: `::fwscanf' has not been declared
/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:153: error: `::getwc' has not been declared
/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:154: error: `::getwchar' has not been declared
/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:159: error: `::putwc' has not been declared
/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:160: error: `::putwchar' has not been declared
/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:161: error: `::swprintf' has not been declared
/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:162: error: `::swscanf' has not been declared
/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:163: error: `::ungetwc' has not been declared
/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:164: error: `::vfwprintf' has not been declared
/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:166: error: `::vfwscanf' has not been declared
/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:168: error: `::vswprintf' has not been declared
/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:170: error: `::vswscanf' has not been declared
/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:172: error: `::vwprintf' has not been declared
/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:174: error: `::vwscanf' has not been declared
/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:182: error: `::wcsftime' has not been declared
/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:189: error: `::wcstod' has not been declared
/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:191: error: `::wcstof' has not been declared
/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:193: error: `::wcstok' has not been declared
/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:194: error: `::wcstol' has not been declared
/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:195: error: `::wcstoul' has not been declared
/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:196: error: `::wcsxfrm' has not been declared
/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:202: error: `::wprintf' has not been declared
/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:203: error: `::wscanf' has not been declared
/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:249: error: `::wcstold' has not been declared
/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:258: error: `::wcstoll' has not been declared
/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:259: error: `::wcstoull' has not been declared
/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:265: error: `__gnu_cxx::wcstold' has not been declared

こんな感じのが大量に出る。

結論からいうと、 http://flightgear.jpn.org/modules/d3forum/index.php?post_id=1628 に書かれている通りで、 -I/usr/include していたのが原因だった。