what's the difference between clang-cl.exe vs clang.exe on Windows?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

what's the difference between clang-cl.exe vs clang.exe on Windows?

Hubert Tong via cfe-dev
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?
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?
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
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: what's the difference between clang-cl.exe vs clang.exe on Windows?

Hubert Tong via cfe-dev


Le 12 sept. 2020 à 11:19, Yafei Liu via cfe-dev <[hidden email]> 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
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev