Thursday, 15 September 2011

c++ - Program when compiled with /MT antivirus capture it as virus -



c++ - Program when compiled with /MT antivirus capture it as virus -

this question has reply here:

my programs blocked avast anti-virus 6 answers

i created programme in c++ when build using vs c++ 2012 using release mode

runtime library: "multithreaded(/mt)

then captured avast antivirus virus. if alter runtime library "multithreaded dll(/md)" avast don't capture virus.

here code

lpwstr _getusername(); void filewriteline(lpcwstr filepath,lpcwstr line); int main() { lpcwstr username = _getusername(); filewriteline(username,l"hello world"); homecoming 1; } void filewriteline(lpcwstr filepath,lpcwstr line) { wfstream filehandle(filepath,ios::out | ios::app); filehandle << line<<endl; filehandle.close(); } lpwstr _getusername() { lpwstr username = new tchar[257]; dword size = 257; if (!getusernamew(username,&size)) { username = _wgetenv(l"username"); if (username == null) { username = l"error-unknown"; } } homecoming username; }

go antivirus menu , set folder executable beingness created exception in firewall.

settings > antivirus > scroll downwards exclusions > file path exclusions > either type in path , add together or browse add together it

c++ visual-c++ antivirus virus microsoft-runtime-library

No comments:

Post a Comment