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

Compiler Error #8

Open
elagrija opened this issue Oct 26, 2022 · 3 comments
Open

Compiler Error #8

elagrija opened this issue Oct 26, 2022 · 3 comments

Comments

@elagrija
Copy link

Error

I 'm getting the above compilation error. Can you please guide to resolve this please.

@elagrija
Copy link
Author

Resolved the errors and got an output.

@kamakala
Copy link

@elagrija, please share how you resolved those errors

@kamakala
Copy link

Nevermind, figured it out: The error is due to passing a wide string (wchar_t*) to e.g. CreateFileA, which expects a const char* string as its first argument. CreateFileA is the ANSI string version of CreateFile and CreateFileW is the wide string (unicode) version. While trying to pass L"NewFile.bat" (which is a wide string), CreateFileW should be used instead of CreateFileA.
In the essence, added "W" character to each pointer that had problems..

The "return with no value, in function returning non-void" error means that you are trying to use an empty return expression in a function that expects a value to be returned. In C, functions declared with a type other than void must always return a value of that type. The main function is of type int, which means that every occurrence of return must have a value to return. Changing to
return -1;
resolves the problem.

What's more, I got some problems during build (missing links).
gcc sysmon-simulator.c -o sysmon-simulator.exe -lws2_32 -ldnsapi -w -lnt
resolves the problem

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