hiyohiyo / CrystalDiskInfo

CrystalDiskInfo
https://github.com/hiyohiyo/CrystalDiskInfo
MIT License
1.59k stars 177 forks source link

error C2039: 'srand': is not a member of 'std' #232

Open jianwu13 opened 12 months ago

jianwu13 commented 12 months ago

1>E:\gitwork_win\CrystalDiskInfo\Priscilla\MainDialogFx.cpp(255,7): error C2039: 'srand': is not a member of 'std' 1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\include\ctime(21,1): message : see declaration of 'std' 1>E:\gitwork_win\CrystalDiskInfo\Priscilla\MainDialogFx.cpp(540,20): error C2039: 'rand': is not a member of 'std' 1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\include\ctime(21,1): message : see declaration of 'std' 1>StaticFx.cpp 1>UtilityFx.cpp 1>Done building project "DiskInfo.vcxproj" -- FAILED. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

srand is in which you did not include.

diff --git a/Priscilla/MainDialogFx.cpp b/Priscilla/MainDialogFx.cpp index 7cf4ddd..7462fbb 100644 --- a/Priscilla/MainDialogFx.cpp +++ b/Priscilla/MainDialogFx.cpp @@ -8,6 +8,9 @@

include "../stdafx.h"

include "MainDialogFx.h"

include

+// ADD start kan 2023/09/05 +#include +// ADD end kan 2023/09/05

CMainDialogFx::CMainDialogFx(UINT dlgResouce, CWnd* pParent) :CDialogFx(dlgResouce, pParent)

VioletGiraffe commented 11 months ago

Same for me. The solution is, of course, to add #include <cstdlib>