# Problems with compiling gollvm project (CMake version 3.18.0)

**URL:** https://discourse.cmake.org/t/problems-with-compiling-gollvm-project-cmake-version-3-18-0/1576
**Category:** Usage
**Created:** [July 16, 2020, 8:08pm UTC](https://discourse.cmake.org/t/problems-with-compiling-gollvm-project-cmake-version-3-18-0/1576 "2020-07-16T20:08:21Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Ivan\_Serdyuk](https://discourse.cmake.org/user_avatar/discourse.cmake.org/ivan_serdyuk/32/217_2.png) [@Ivan\_Serdyuk](https://discourse.cmake.org/u/Ivan_Serdyuk)
#### Post date: [July 16, 2020, 8:08pm UTC](https://discourse.cmake.org/t/problems-with-compiling-gollvm-project-cmake-version-3-18-0/1576/1 "2020-07-16T20:08:22Z")

</div>

Hi.  
I am experiencing some issues, related to [https://go.googlesource.com/gollvm/](http://Gollvm).

C:\Users\Worker\gollvm\build-debug\>cmake -DCMAKE\_BUILD\_TYPE=Debug -DLLVM\_USE\_LINKER=gold -G Ninja …/llvm-project/llvm  
– The C compiler identification is Clang 11.0.0 with GNU-like command-line  
– The CXX compiler identification is Clang 11.0.0 with GNU-like command-line  
– The ASM compiler identification is Clang  
– Found assembler: C:/Program Files/LLVM/bin/clang.exe  
– Detecting C compiler ABI info  
– Detecting C compiler ABI info - failed  
– Check for working C compiler: C:/Program Files/LLVM/bin/clang.exe  
– Check for working C compiler: C:/Program Files/LLVM/bin/clang.exe - broken  
CMake Error at C:/Program Files/CMake/share/cmake-3.18/Modules/CMakeTestCCompiler.cmake:66 (message):  
The C compiler

```
"C:/Program Files/LLVM/bin/clang.exe"

```

is not able to compile a simple test program.

It fails with the following output:

```
Change Dir: C:/Users/Worker/gollvm/build-debug/CMakeFiles/CMakeTmp

Run Build Command(s):C:/Users/Worker/AppData/Local/Programs/Python/Python38-32/Scripts/ninja.exe cmTC_6ed0b && [1/2] Building C object CMakeFiles/cmTC_6ed0b.dir/testCCompiler.c.obj
[2/2] Linking C executable cmTC_6ed0b.exe
FAILED: cmTC_6ed0b.exe
cmd.exe /C "cd . && C:\PROGRA~1\LLVM\bin\clang.exe -fuse-ld=lld-link -nostartfiles -nostdlib -g -Xclang -gcodeview -O0 -D_DEBUG -D_DLL -D_MT -Xclang --dependent-lib=msvcrtd CMakeFiles/cmTC_6ed0b.dir/testCCompiler.c.obj -o cmTC_6ed0b.exe -Xlinker /implib:cmTC_6ed0b.lib -Xlinker /pdb:cmTC_6ed0b.pdb -Xlinker /version:0.0 -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 -loldnames && cd ."
lld-link: error: <root>: undefined symbol: mainCRTStartup
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

```

CMake will not be able to correctly generate this project.  
Call Stack (most recent call first):  
CMakeLists.txt:57 (project)

– Configuring incomplete, errors occurred!  
See also “C:/Users/Worker/gollvm/build-debug/CMakeFiles/CMakeOutput.log”.  
See also “C:/Users/Worker/gollvm/build-debug/CMakeFiles/CMakeError.log”.

C:\Users\Worker\gollvm\build-debug\>clang -v  
clang version 11.0.0  
Target: x86\_64-pc-windows-msvc  
Thread model: posix  
InstalledDir: C:\Program Files\LLVM\bin

> cl /Wv  
> Оптимизирующий компилятор Microsoft (R) C/C++ версии **19.24.28117** для x86  
> I am using VS 2019 Preview.

Ivan

---

<div class="post-metadata">

### Author: ![bill.hoffman](https://discourse.cmake.org/user_avatar/discourse.cmake.org/bill.hoffman/32/13_2.png) [@bill.hoffman](https://discourse.cmake.org/u/bill.hoffman)
#### Post date: [July 27, 2020, 10:34pm UTC](https://discourse.cmake.org/t/problems-with-compiling-gollvm-project-cmake-version-3-18-0/1576/2 "2020-07-27T22:34:44Z")

</div>

Looks like the compiler that you are using with those flags does not work. CMake is basically compiling a hello world program and the linker is missing mainCRTStartup. Outside of CMake if you ran clang with those options it should fail in the same way.

---

<div class="post-metadata">

### Author: ![Ivan\_Serdyuk](https://discourse.cmake.org/user_avatar/discourse.cmake.org/ivan_serdyuk/32/217_2.png) [@Ivan\_Serdyuk](https://discourse.cmake.org/u/Ivan_Serdyuk)
#### Post date: [January 13, 2021, 8:24pm UTC](https://discourse.cmake.org/t/problems-with-compiling-gollvm-project-cmake-version-3-18-0/1576/3 "2021-01-13T20:24:23Z")

</div>

Yes, that’s right.  
You may close this.
