# Build Slicer failed on win10

**URL:** <https://discourse.slicer.org/t/build-slicer-failed-on-win10/15674>\
**Category:** Development\
**Tags:** build\
**Created:** [January 26, 2021, 8:24am UTC](https://discourse.slicer.org/t/build-slicer-failed-on-win10/15674 "2021-01-26T08:24:10Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![kejuhn](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/kejuhn/32/10826_2.png) [@kejuhn](https://discourse.slicer.org/u/kejuhn)\
**Post date:** [January 26, 2021, 8:24am UTC](https://discourse.slicer.org/t/build-slicer-failed-on-win10/15674/1 "2021-01-26T08:24:10Z")

</div>

Hi,

I followed the Build Instructions to build Slicer on Windows 10.  
CMake: 3.19.3  
Git: 2.30.0.2  
Qt: 5.15.2 64-bit (MSVC 2019)  
Visual Studio 2019 C++ x64  
After build Slicer in Visual Studio, 5 errors occurred.

 ![圖片1](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/4/c4ee7fe371415d0245d7c6b73aa627e3677eb13d.jpeg)

How to solve these errors? Thanks!

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [January 26, 2021, 8:51am UTC](https://discourse.slicer.org/t/build-slicer-failed-on-win10/15674/2 "2021-01-26T08:51:33Z")

</div>

Not sure it is related to your error, but you need to use a short superbuild path on Windows. For example `d:\s\S4D`

---

<div class="post-metadata">

**Author:** ![kejuhn](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/kejuhn/32/10826_2.png) [@kejuhn](https://discourse.slicer.org/u/kejuhn)\
**Post date:** [January 27, 2021, 8:00am UTC](https://discourse.slicer.org/t/build-slicer-failed-on-win10/15674/3 "2021-01-27T08:00:24Z")

</div>

Hi,  
I try again.  
The source folder is set to as C:\S4, and the build folder is set to as C:\S4R.

 ![2021-01-27 10 31 28](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/6/2/6225cbab195d268fb6c70a9d4ee479d31f79327d.png)

After build Slicer in Visual Studio, 5 errors also occurred.

 ![2021-01-27 15 52 30](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/3/4/34106c2f3c19224611302945460562fda0bcb5fa.png)

I don’t know where the settings are wrong.  
Please help me to solve these errors. Thanks!

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [January 27, 2021, 5:39pm UTC](https://discourse.slicer.org/t/build-slicer-failed-on-win10/15674/4 "2021-01-27T17:39:29Z")

</div>

The error list window in Visual Studio shows the errors in a somewhat random order. The errors that you show in the screenshot (all of them due to missing `archive.h`) are consequence of some previous errors that we don’t see.

Can you upload the full build log (not the content of “Error list” but content of “Output” window) somewhere and post the download link here?

---

<div class="post-metadata">

**Author:** ![kejuhn](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/kejuhn/32/10826_2.png) [@kejuhn](https://discourse.slicer.org/u/kejuhn)\
**Post date:** [January 29, 2021, 12:30am UTC](https://discourse.slicer.org/t/build-slicer-failed-on-win10/15674/5 "2021-01-29T00:30:40Z")

</div>

Hi,

Here is the [full build log](https://drive.google.com/file/d/15pQXad09ZRG20k_LQCAXfU6_uXXPqLoG/view?usp=sharing).

Thanks for your replay!

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [January 29, 2021, 5:32am UTC](https://discourse.slicer.org/t/build-slicer-failed-on-win10/15674/6 "2021-01-29T05:32:24Z")

</div>

Probably the issue is that your system code page is set to 950 (Traditional Chinese) and c:\S4R\LibArchive\libarchive\archive\_read\_support\_format\_rar5.c contains characters that cannot be interpreted in this code page.

The simplest is to remove the offending characters (remove entire line 74, it is just a comment):

```
 * "Rar!→•☺·\x00"

```

If you will keep running into similar errors then you may consider switching to Latin1 code page for the build.

---

<div class="post-metadata">

**Author:** ![kejuhn](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/kejuhn/32/10826_2.png) [@kejuhn](https://discourse.slicer.org/u/kejuhn)\
**Post date:** [February 1, 2021, 12:27am UTC](https://discourse.slicer.org/t/build-slicer-failed-on-win10/15674/7 "2021-02-01T00:27:56Z")

</div>

It’s solved by your method.  
Thanks for your help!

---

<div class="post-metadata">

**Author:** ![moonchi](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/moonchi/32/10784_2.png) [@moonchi](https://discourse.slicer.org/u/moonchi)\
**Post date:** [April 26, 2021, 12:51pm UTC](https://discourse.slicer.org/t/build-slicer-failed-on-win10/15674/8 "2021-04-26T12:51:15Z")

</div>

Hello, I am a graduate student in a master class, and I am currently working on building a 3D slicer, and some building errors are happening to me. It is convenient for you to ask if the five errors are all solved by deleting the comments, or Is it useful for other solutions? If you are willing and available, is it convenient to email you for more details. Thank you! It doesn’t matter if you don’t want to, thank you for reading.

> **Machine-translated from Chinese**
>
> 你好，我是一個碩班的研究生，目前也正在進行建置3D slicer的作業，有些建置錯誤我也正在發生，方便跟請問您五項錯誤都是把註釋刪掉就解決了嗎，還是有用了其他解決方式呢?如果您願意也有空，方便跟您要email請教詳細細節嗎。謝謝!不願意也沒有關係，謝謝您閱讀。
