3

I generated a Visual Studio 15 2017 project with CMake to compile LLVM and Clang myself. I've tried to build the ALL_BUILD project from Visual Studio (as the getting started page suggested).

But the build failed with a linking error due to (I assume) the linker did not have permission to open a file. This specific file was LLVM-C.def.

The error message:

Cannot Open File '<path_to_build_folder>/build/tools/llvm-shlib/LLVM-C.def

I've tried to give full permission to the user, also tried as admin but did not work.

edit:

The file did not get created because the gen-msvc-exports.py script fails to locate a libllvm-c.args file. It searches the Debug directory for this file but I found it in the $(Configuration) directory. Could this be some Visual Studio configuration/macro problem?

edit2:

Also is there any workaround to get the Clang Tooling library to work on Windows? The precompiled package doesn't contain any headers or static libraries to work with (but for some reason the Linux one does).

Bako
  • 313
  • 1
  • 15
  • Are you using the x86 host or 64bits? – Matthieu Brucher Jan 28 '19 at 17:11
  • @MatthieuBrucher I'am using the 64 bits one. – Bako Jan 28 '19 at 17:13
  • @drescherjm I edited the question – Bako Jan 28 '19 at 17:19
  • Do you want to compile your project with CMake or Visual Studio ? They both do the same Job. Cmake uses CMakelist to compile while Visual studios does not. You can compile your Project with CMake and use Visual studios Compiler or Mingw4 GCC compiler. – Juniar Jan 29 '19 at 02:17
  • There is also a difference with the kind of project you are handling, does it contain CMakelist file? If so then such projects should be compiled on CMake not Visual studios. – Juniar Jan 29 '19 at 02:22
  • @Juniar I don't mind either way. I used CMake to generate a Visual Studio build system. There should be no difference between what build system I use, I wanted to use VS15 2017 because it seemed easier. Also, the only `LLVM on Windows` tutorial on the official site uses a VS build system – Bako Jan 29 '19 at 09:44
  • @Juniar I've tried to generate a MinGW build system and compile it with MinGW (GCC 5.1) too but turns out mingw-w64 does not implement a C++11 `std::errc::not_supported` error code that LLVM would like to use, so it only raises more errors – Bako Jan 29 '19 at 15:58
  • @ Bako, you can Manually add these missing C++ std files by copying them onto mingw-w64/.../../ bin or any other path that the compiler searches for. I also prefer dlls file types than the standard lib. – Juniar Jan 31 '19 at 20:39
  • @Juniar Actually that was a known bug and they fixed it in GCC 5.5 and above so that problem is solved. Now I'm getting other kinds of errors that I try to fix but it takes a lot of time due to the 4-5 hours of compilation time. – Bako Jan 31 '19 at 22:12
  • @Bako Why is it taking that many hours to compile? Usually it takes less than an hour. Are you running other programs in the background. – Juniar Feb 02 '19 at 02:43
  • @Juniar No I don't, I just have an old i3-3220 CPU. – Bako Feb 02 '19 at 10:06

0 Answers0