AVs hate the use of system() |
I know that part of the "story". But, let me say, there are alternatives to system, it's like senseless to stop system when you can do the same with, say, ShellExecute (Windows).
Also, I don't think at all it's the "act of compilation" that "marks" a program with "Hey look, I'm a virus".
Because, what an antivirus sees is a file being written, byte by byte, to a file with exe extension. Besides eventual malign exe unpackers (who are exes themself >_>) that can't be the reason too, because say you are using winrar to extract a exe file, winrar isn't marked as a virus.
MD5 equality is to be excluded.
So, yeah, the reason is that an antivirus, looking at the imported functions, looks for malicious functions like system and who knows what other functions (but as I said over, it's useless, there is always a way through unless people stop downloading random things, like unlegits or unofficial tools not recommended, or clicking advertisements for programs that "clean your pc").
It may also look up the MD5 in a malicious MD5 database.
So you can:
1. Remove your suspicious calls and replace with equivalent
or
2. Use OS-Specific functions to import at run-time the required suspicious functions (Windows -> LoadLibrary/GetProcAddress/FreeLibrary)