[Clang] Windows + Clang + MinGW- unfinished

// insert a hyperlink yet

   

This article briefly introduce about how to use, I was not intelligible, so do not hold out much hope.

   

table of Contents

What Clang that? What is MinGW? : Compiler GCC and Clang of similarities and differences

The two of them together can be doing?

   

Clang is a compiler front-end, so I do not know, probably not directly use, to tie the back end use. Here, we will use MinGW as the back end to Clang combined into a full compiler.

You must first install Clang: Clang installation tutorial

Then install MinGW: MinGW installation tutorial

Configure their own environment variables: configuration environment variable tutorial

Open cmd, enter the following command to test the installation was successful

If not the above results, it is misplaced, or environment variable is not configured

Then it can officially began, in fact, Clang is fully compatible with the gcc, gcc commands that it can be used completely.

such as. In gcc

C:\Users\lenovo> gcc -E test.c -o test.i

Pretreatment

C:\Users\lenovo> gcc -S test.i -o test.s

Compile

C:\Users\lenovo> gcc test.s -o test.exe

compilation

In the clang

C:\Users\lenovo> clang -E test.c -o test.i

Pretreatment

C:\Users\lenovo> clang -S test.i -o test.s

Compile

C:\Users\lenovo> clang test.s -o test.exe --target=x86_64-pc-mingw64

compilation

   

Explain command called red blue, yellow call options, white parameters

-o represents the output file rename, -E represents a pretreatment, -S represents compiler, - target compiler flag specifies backend

Guess you like

Origin www.cnblogs.com/jawide/p/11973198.html