[cfe-dev] what's the difference between clang-cl.exe vs clang.exe on Windows?

Jean-Daniel via cfe-dev cfe-dev at lists.llvm.org
Sat Sep 12 05:27:12 PDT 2020



> Le 12 sept. 2020 à 11:19, Yafei Liu via cfe-dev <cfe-dev at lists.llvm.org> a écrit :
> 
> I'm totally new to Window C++ programming and today I port my project on Windows and use clang.exe as the compile but failed on CMake configuration (lot's of library not found, for example clang.exe: error: no such file or directory: '/DWIN32' )
> 
> I did some research and found out that I should use clang-cl.exe and the project finally got compiled, but I still know nothing about the clang and clang-cl, here's my question:
> 
> 1. Does clang-cl compile the source to object file by itself or is it just a wrapper of MSVC?

clang-cl.exe is an alias to clang.exe that automatically configure it in MSVC compatible mode. It still do all the work itself but support MSCV flag syntax, MSCV library search path, MSVC ABI, etc.

clang-cl.exe is designed to replace cl.exe as transparently as possible.


> 2. What's the differences between clang.exe and clang-cl.exe?
> 3. Does clang-cl and clang both link to Windows version c++ standard libraries on Windows platform?

I don’t remember what clang.exe does exactly, but I’m not sure it targets MSVC ABI by default when running on Windows, so it can’t link on MSVC libraries. I think it used to work more like MSYS/MinGW does, but don’t know if it changed since then.

> 4. Followed by 3, I alway feel uncomfortable to debugging codes on Window C++ std libraries, for example on Linux, I can check values saved in a vector, but on windows it's possible, it seems that Windows use another way to implement it, I can only check the first and the last elements. So any way I can use Linux versions (I don't know how to name it, maybe gcc version)? 
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20200912/f4905a22/attachment-0001.html>


More information about the cfe-dev mailing list