0

This is my first post. So if something is incorrect in formatting text, please tell me about it.

I'm the most beginner of beginners. I was wondering whether it's possible to make llvm compiler works in Code::Blocks. I'M USING WINDOWS 10. I've tried a lot different solution that was written here on stackoverflow, but 100% of them were for Linux users, and nothing helped me.

The problem is next. I installed LLVM, installed Code::Blocks, creating new the-best-project-ever-developed-by-mankind Hello world output into console, and actually it's written already by Code::Blocks base for C++ console projects, and I can't build it. Fresh simple project impossible to build out-of-box. The error I get is:

D:\projects\c++\cpptest\egergerger\main.cpp|1|fatal error: 'iostream' file not found

When I tried to run it from cmd.exe it throws me:

D:\projects\c++\cpptest\egergerger>clang main.cpp
clang: warning: unable to find a Visual Studio installation; try running Clang from a developer command prompt [-Wmsvc-not-found]
main.cpp:1:10: fatal error: 'iostream' file not found
#include <iostream>

Now I'm wondering whether it's even possible to make Clang/LLVM compiler works in Code:Blocks Windows edition using Widows OS.

Just now also tried to use something called msys2, didn't helped me.

Thanks!

I'm expecting to build simple Hello world program using Clang/LLVM and Code:Blocks.

adainx
  • 11
  • 2
  • Does this answer your question? [How run clang from command line on Windows?](https://stackoverflow.com/questions/18711595/how-run-clang-from-command-line-on-windows) – dewaffled Feb 25 '23 at 15:33

1 Answers1

1

I think I made it works somehow. The solution from here helped me -> Solution

This helped me to install Clang/LLVM with all the necessary basic files I needed pacman -S mingw-w64-clang-x86_64-clang using MSYS2. I deleted old and added new compiler to PATH. Deleted Code::Blocks with GCC compiler, and deleted all the CodeBlocks from Users Roaming folder, and installed Code::Blocks with no compiler. I reboot my laptop, launched Code::Blocks and it found LLVM Compiler that I installed from the Solution, I created new console project and it now compiles and works great.

I had to try it before posting my question here. Thanks!

adainx
  • 11
  • 2