ScarredMonk/SysmonSimulator

Compiler Error

Opened this issue · 3 comments

Error

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

Resolved the errors and got an output.

@elagrija, please share how you resolved those errors

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