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

BUG in code (cpp) #133

Open
oferrr opened this issue Feb 3, 2023 · 2 comments
Open

BUG in code (cpp) #133

oferrr opened this issue Feb 3, 2023 · 2 comments
Labels
bug help wanted windows Issue with Windows version

Comments

@oferrr
Copy link

oferrr commented Feb 3, 2023

I tried to compile the C++ code (for windows 11) with g++ (mingw) and I get a bug:

PS C:\Users\User\Keylogger\windows> g++ -c klog_main.cpp
klog_main.cpp: In function 'int Save(int)':
klog_main.cpp:132:57: error: 'strcpy_s' was not declared in this scope
strcpy_s(lastwindow, sizeof(lastwindow), window_title);
^
klog_main.cpp:137:23: error: 'localtime_s' was not declared in this scope
localtime_s(&tm, &t);
^

Is this a bug or problem in my pc?

@k0dzi
Copy link

k0dzi commented Feb 6, 2023

Experienced this as well application works fine to log keystrokes but is not saving to .txt file on windows

@GiacomoLaw
Copy link
Owner

GiacomoLaw commented Oct 4, 2023

Using MinGW? Localtime_s doesn't work on stuff outside Windows compilers.

Try adding this:

define localtime_r(T,Tm) (localtime_s(Tm,T) ? NULL : Tm)

Does this help?

Commit 4d06f98 should solve with the top issue. I am very rusty with CPP so help would be appreciated.

@GiacomoLaw GiacomoLaw added bug help wanted windows Issue with Windows version labels Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help wanted windows Issue with Windows version
Projects
None yet
Development

No branches or pull requests

3 participants