我刚开始在Windows上使用clang-cl 3.7.我尝试通过Visual Studio 2015和trough命令行在我的WIN8.1机器上编译我的代码.不用说,在那之前,在同一个cmd中,我运行vsvarsall了amd64选项.
这是我的代码:
#define UNICODE
#include <Windows.h>
#include <iostream>
int main() {
int a = 0;
if(0)
__asm _emit 0xE8
else
a=3;
if (IsDebuggerPresent())
MessageBox(
NULL,
(LPCWSTR)L"Debugger detected!!",
(LPCWSTR)L"!!!!!",
MB_ICONWARNING | MB_CANCELTRYCONTINUE | MB_DEFBUTTON2
);
return 0;
}
Run Code Online (Sandbox Code Playgroud)
这是我在命令行中输入的内容:
C:\Program Files\LLVM\bin>"C:\Program Files\LLVM\bin\clang-cl.exe" "C:\Users\Dav
id\Source\Repos\DY Obfuscator 2015-20162\DY Obfuscator\Source.cpp"
Run Code Online (Sandbox Code Playgroud)
在VS2015中编译工作正常,但我无法在命令行上编译,因为我收到此错误:
C:\Program Files\LLVM\bin>"C:\Program Files\LLVM\bin\clang-cl.exe" C:\test\Sourc
e.cpp
In file included from C:\test\Source.cpp:3:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INC
LUDE\iostream:6:
In file included from C:\Program …Run Code Online (Sandbox Code Playgroud)