Windows Mobile 6 VisualStudio2005 で time 関数が使えない
ナビゲーションに移動
検索に移動
目次
Windows Mobile 6 VisualStudio2005 で time 関数が使えない
Windows Mobile | Visual Studio 2005 |
time関数が使えない
乱数を生成しようと、以下のようなソースを記述するも、
- #include <time.h>
- :
- srand( (unsigned)time( NULL ) );
- :
- int ope1 = rand() % mn;
LNK2019 エラー発生
どうもWindows CE用のVisual C++の標準関数には、time.tに存在する関数群が欠落しているらしい。。。
- http://netlog.jpn.org/r271-635/2008/05/windows_ce_timet.html
- http://blog.goo.ne.jp/yuki90r/e/f4604225eac392b550d7a31430f19bc2
- http://outside.samuson.com/mtblog/windows_mobile/
仕方がないので、以下のようなコーディングを行う(MFC)
- SYSTEMTIME st;
- GetSystemTime(&st);
- CTime ct = CTime(st);
- srand((unsigned)ct.GetTime());
© 2006 矢木浩人