Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jianwu13 opened this issue Sep 5, 2023 · 1 comment
Open

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

jianwu13 opened this issue Sep 5, 2023 · 1 comment

Comments

@jianwu13
Copy link

jianwu13 commented Sep 5, 2023

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
Copy link

VioletGiraffe commented Sep 30, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants