messy, these options are important in that case:
cl /GS- /MD /ENTRY:main /FIXED
Sure, let's make a test:
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe" /GS- /MD /ENTRY:main /FIXED "Tmp.c" user32.lib kernel32.lib ucrt.lib
Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24215.1 for x86
Copyright (C) Microsoft Corporation. All rights reserved.
cl : Command line warning D9002 : ignoring unknown option '/ENTRY:main'
Tmp.c
Tmp.c: fatal error C1083: Cannot open include file: 'XED': No such file or directory
So sad, as Donald Dumb would say
But let's test also the long commandline of aw27:
J:\Masm32\MasmBasic\Res>"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe" /GS- /TC /GL /analyze- /W3 /Gy /Zc:wchar_t /
Zi /Gm- /O1 /fp:precise /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /errorReport:prompt /WX- /Zc:forScope /Gd /Oy- /
Oi /MD /nologo /Fe /Fombr.obj Tmp.cpp /link /OUT:mbr.exe /ENTRY:main /SUBSYSTEM:CONSOLE /DYNAMICBASE:NO /FIXED /MACHINE:X86 /OPT:REF /SA
FESEH:NO /INCREMENTAL:NO kernel32.lib ucrt.lib
Tmp.cpp
c:\program files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis\sourceannotations.h(79): error C2059: syntax error: '['
c:\program files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis\sourceannotations.h(110): error C2059: syntax error: '['
c:\program files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis\sourceannotations.h(141): error C2059: syntax error: '['
c:\program files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis\sourceannotations.h(153): error C2059: syntax error: '['
c:\program files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis\sourceannotations.h(163): error C2059: syntax error: '['
c:\program files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis\sourceannotations.h(174): error C2059: syntax error: '['
c:\program files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis\sourceannotations.h(184): error C2059: syntax error: '['
c:\program files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis\sourceannotations.h(194): error C2059: syntax error: '['
c:\program files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis\sourceannotations.h(206): error C2059: syntax error: '['
More trial and error...? Now I will tell you a secret: This ridiculously simple hello world proggie fails miserably with various versions of MCVC and GCC, despite the commandlines suggested by real experts
TM, but it builds fine with Pelles C - provided you do something very logical, that is, add a
W to the line
HANDLE hFile = CreateFile(L"\\\\.\\PhysicalDrive0", ...
Of course, it will still fail miserably with the other compilers, but hey, wouldn't it be fun to spend some weeks on solving the puzzle? Especially if you are bored, of course