Author Topic: To use Clang-cl.exe with Codeblocks on Windows 10 needs a new compiler type  (Read 261 times)

Offline pabristow

  • Multiple posting newcomer
  • *
  • Posts: 30
I have been trying to use CodeBlocks on Windows 10 to using the latest Clang compiler (8.0) to build Boost libraries especially Boost.Math and Boost.Multiprecision, but conclude after some confusing work that Windows really needs a new compiler type using clang-cl.exe and not clang.exe.  This is because Clang-cl.exe is a variant specifically adapted to work with Windows (and Visual studio) and it responds, confusingly, to (some) MS style configuration command like /EHsc (and not -fexceptions) and /std:c++17 (and not -std=c++17).

In turn, this also has implications for Boost's complex multi-platform configuration system.

This means some changes are needed to

 C:\Program Files (x86)\CodeBlocks\share\CodeBlocks\templates\wizard\common_functions.script


C:\Program Files (x86)\CodeBlocks\share\CodeBlocks\compilers\options_clang.xml

that at a glance I conclude are not in my skill-set ;)

I hope someone will be able to tackle this for the next release because it allows side-by-side IDE development of code for GCC and Clang, something that Visual Studio still does not permit.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2379
Can you show a command line, how a typical c-lang compilation for windows would look like? i can not find anything in the link you provided...

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11827
    • Travis build status
Are you using the llvm compiler to run clang-cl?
Have you tried to run the Visual studio compiler instead?
clang-cl is meant to be a drop in replacement for cl.exe, so it should work just fine when using with the Visual studio compiler in Code::Blocks.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]