# Building error

**URL:** https://discourse.kitware.com/t/building-error/128
**Category:** Pulse Physiology Engine
**Created:** [July 10, 2018, 8:06am UTC](https://discourse.kitware.com/t/building-error/128 "2018-07-10T08:06:57Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![bingyu11](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/b/8edcca/32.png) [@bingyu11](https://discourse.kitware.com/u/bingyu11)
#### Post date: [July 10, 2018, 8:06am UTC](https://discourse.kitware.com/t/building-error/128/1 "2018-07-10T08:06:57Z")

</div>

I was building the source file (CMakeLists) using Qt , but the following error occurs during building:

- D8016 : ‘/EHs’ and ‘/clr’ command-line options are incompatible

I also tried to build the file using CMake-gui (following the instruction you provided on GitLab), but there are only three empty folders in install/bin. And the run command doesn’t work. Could you let me know what the possible reason is and how to build the file correctly? Thanks in advance.

Weijun

---

<div class="post-metadata">

### Author: ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)
#### Post date: [July 10, 2018, 11:11am UTC](https://discourse.kitware.com/t/building-error/128/2 "2018-07-10T11:11:03Z")

</div>

What operating system and compiler are you using?

---

<div class="post-metadata">

### Author: ![bingyu11](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/b/8edcca/32.png) [@bingyu11](https://discourse.kitware.com/u/bingyu11)
#### Post date: [July 10, 2018, 11:41am UTC](https://discourse.kitware.com/t/building-error/128/3 "2018-07-10T11:41:14Z")

</div>

I used MSVS compiler in Windows 10.

---

<div class="post-metadata">

### Author: ![bingyu11](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/b/8edcca/32.png) [@bingyu11](https://discourse.kitware.com/u/bingyu11)
#### Post date: [July 10, 2018, 11:45am UTC](https://discourse.kitware.com/t/building-error/128/4 "2018-07-10T11:45:41Z")

</div>

Sorry, it’s MSVC. I changed all the ‘EHs’ to ‘EHa’ and this error disappears, but another one occurs:

- 👎 error: LNK1104: cannot open file ‘MSCOREE.lib’

---

<div class="post-metadata">

### Author: ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)
#### Post date: [July 10, 2018, 11:54am UTC](https://discourse.kitware.com/t/building-error/128/5 "2018-07-10T11:54:32Z")

</div>

What version of msvc is it?

---

<div class="post-metadata">

### Author: ![bingyu11](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/b/8edcca/32.png) [@bingyu11](https://discourse.kitware.com/u/bingyu11)
#### Post date: [July 10, 2018, 11:59am UTC](https://discourse.kitware.com/t/building-error/128/6 "2018-07-10T11:59:23Z")

</div>

It’s 2017. I’m wondering whether it is compatible with windows 10 and SDK 10.

---

<div class="post-metadata">

### Author: ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)
#### Post date: [July 10, 2018, 12:07pm UTC](https://discourse.kitware.com/t/building-error/128/7 "2018-07-10T12:07:40Z")

</div>

Win10 and 2017 have build it fine, but I am building a fresh pull now.

Are you choosing 64bit?

It sounds like it’s the C# example having issues for some reason.

Let me see how this build goes…

---

<div class="post-metadata">

### Author: ![bingyu11](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/b/8edcca/32.png) [@bingyu11](https://discourse.kitware.com/u/bingyu11)
#### Post date: [July 10, 2018, 12:12pm UTC](https://discourse.kitware.com/t/building-error/128/8 "2018-07-10T12:12:51Z")

</div>

Yes, it’s the 64bit version. I also tried the instruction you provided using CMake-gui, but after building finished, the folder install bin is empty except three empty subfolders. That’s why I choose Qt to open the CMakeLists file.

---

<div class="post-metadata">

### Author: ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)
#### Post date: [July 10, 2018, 12:17pm UTC](https://discourse.kitware.com/t/building-error/128/9 "2018-07-10T12:17:48Z")

</div>

When you open visual studio and under help, look at the ‘About Visual Studio’ and send me the version (something like 15.5.0)

---

<div class="post-metadata">

### Author: ![bingyu11](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/b/8edcca/32.png) [@bingyu11](https://discourse.kitware.com/u/bingyu11)
#### Post date: [July 10, 2018, 12:22pm UTC](https://discourse.kitware.com/t/building-error/128/10 "2018-07-10T12:22:09Z")

</div>

It’s 15.7.4. Please check out the snapshot of the information.

 ![MSVC%20version](https://discourse.kitware.com/uploads/default/original/1X/684d54ba176acc1e57a390a8ed477d8f4aaf56ea.jpg)

---

<div class="post-metadata">

### Author: ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)
#### Post date: [July 10, 2018, 12:24pm UTC](https://discourse.kitware.com/t/building-error/128/11 "2018-07-10T12:24:23Z")

</div>

Thanks, I was on 15.5.0, am updating to 15.7.4 now and will fix these issues. These new compiler updates can cause issues. I will keep you posted.

---

<div class="post-metadata">

### Author: ![bingyu11](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/b/8edcca/32.png) [@bingyu11](https://discourse.kitware.com/u/bingyu11)
#### Post date: [July 10, 2018, 12:27pm UTC](https://discourse.kitware.com/t/building-error/128/12 "2018-07-10T12:27:06Z")

</div>

Thanks, looking forward to your updates.

---

<div class="post-metadata">

### Author: ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)
#### Post date: [July 10, 2018, 2:20pm UTC](https://discourse.kitware.com/t/building-error/128/13 "2018-07-10T14:20:34Z")

</div>

I updated to 15.7.4 and built without issue on Win10

The /EHa for C++ exceptions is default

It sounds like everything is building except the PulseCLR project, which is managed C++.  
Try opening up the Pulse.sln in the Pulse folder in your build folder. I suspect everything is building except the PulseCLR?

Did you just install MSVC? Maybe an option is missing?

If PulseCLR is indeed the only project not building, then can you post the build log here for it?

---

<div class="post-metadata">

### Author: ![bingyu11](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/b/8edcca/32.png) [@bingyu11](https://discourse.kitware.com/u/bingyu11)
#### Post date: [July 10, 2018, 2:39pm UTC](https://discourse.kitware.com/t/building-error/128/14 "2018-07-10T14:39:47Z")

</div>

I changed the /EHsc to /EHa myself due to the incompatibility issue.

I think there indeed is something wrong with the PulseCLR project, but after the above change, the ‘cannot open file ‘MSCOREE.lib’’ issue happens. I don’t know why.

I installed MSVC several months ago, and only checked the option Desktop development with C++ (please check the attached picture

 ![built%20log](https://discourse.kitware.com/uploads/default/original/1X/c696fb1fdc556d0c2196efef1534da7f63092269.jpg)).

The log is attached below, I built it in Qt.

 ![vs%20components](https://discourse.kitware.com/uploads/default/original/1X/da01bd6e5dc2bf53168e75444f822138facb1e99.jpg)

---

<div class="post-metadata">

### Author: ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)
#### Post date: [July 10, 2018, 2:54pm UTC](https://discourse.kitware.com/t/building-error/128/15 "2018-07-10T14:54:45Z")

</div>

Can you try checking the C++/CLI support option?

This is what I have installed on my system.

 ![MSVC_Options](https://discourse.kitware.com/uploads/default/original/1X/96fa614b7f11276acb70030572dfc5b49b897f69.png)

---

<div class="post-metadata">

### Author: ![bingyu11](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/b/8edcca/32.png) [@bingyu11](https://discourse.kitware.com/u/bingyu11)
#### Post date: [July 10, 2018, 2:57pm UTC](https://discourse.kitware.com/t/building-error/128/16 "2018-07-10T14:57:51Z")

</div>

I’m modifying the visual studio installation, and will see if it works or not.

---

<div class="post-metadata">

### Author: ![bingyu11](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/b/8edcca/32.png) [@bingyu11](https://discourse.kitware.com/u/bingyu11)
#### Post date: [July 10, 2018, 3:26pm UTC](https://discourse.kitware.com/t/building-error/128/17 "2018-07-10T15:26:17Z")

</div>

I tried again, but another problem happens. I built in both Visual Studio and Qt, and attached their building output below. Hope you can figure out the possible reason.

 ![vs%20building](https://discourse.kitware.com/uploads/default/original/1X/779366cd05ade9d81158d61bb2a0379bb179a5ed.jpg) ![Qt%20building](https://discourse.kitware.com/uploads/default/original/1X/148fe9da32ebb4d6139a6fca765b90fbba798ad5.jpg)

---

<div class="post-metadata">

### Author: ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)
#### Post date: [July 10, 2018, 3:31pm UTC](https://discourse.kitware.com/t/building-error/128/18 "2018-07-10T15:31:08Z")

</div>

You have a space in the folder path of your build directory ‘Dev One’  
Something in my CMake needs quotes, but I am not sure where.  
I still need to fix this.

Can you put your build directory in a path without spaces and regenerate cmake and rebuild

Also,  
Are you interested in the PulseCLR project? It is an example of creating a managed C++ dll that can interface with C# and from there things like Unity?  
I think I should also add a CMake option to turn that on/off so other users do not run into this same issue if they don’t have the correct MSVC packages installed…

---

<div class="post-metadata">

### Author: ![bingyu11](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/b/8edcca/32.png) [@bingyu11](https://discourse.kitware.com/u/bingyu11)
#### Post date: [July 10, 2018, 3:35pm UTC](https://discourse.kitware.com/t/building-error/128/19 "2018-07-10T15:35:44Z")

</div>

Ok, I’ll move it to another place and try again. I think we don’t need this project right now. That would be better if you can provide an option to turn it off.

---

<div class="post-metadata">

### Author: ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)
#### Post date: [July 10, 2018, 10:40pm UTC](https://discourse.kitware.com/t/building-error/128/20 "2018-07-10T22:40:42Z")

</div>

It looks like I do indeed combine the /clr and /EHa switch for the CLR and /EHs is indeed not compatible with /clr  
So /clr and /EHa are correct, I suspect adding the C++/CLR support to visual studio helped it.

I will add a switch to the Pulse superbuild to turn off the CLR build if you don’t want to mess with managed code in MSVC, The PulseCLR project will not be created so I will leave it enabled by default, so the project will be created. I will also add notes to the readme explaining this.

Concerning the last two error screen shots. They seem to be two different errors related to two seperate compilers.

1.) For some reason, ninja in msvc is not processing a post build command properly. I have not hooked up ninja in my visual studio environment, so I will need to do this and see what exactly is it complaining about and why. I pulled Pulse into a directory with a space in the path, as well as created a build directory with a space in the path and had no issue building, so I am suspecting ninja is not liking something somewhere… I will see if I can get ninja up and running on my windows system and see what the bad $-escape error is… I do use some specific MSVC macros when building through MSVC, so I suspect niinja does not know what to do with those macros…

2.) For the Qt error, are you building Debug? It seems as if the libprotobufd.lib was not built for some reason, or is not in the expected location… I can try and see what that error is as well.

There are lots of ways to compile a program and I have not tried these combinations… Only vanilla MSVC on windows

[Next page](https://discourse.kitware.com/t/building-error/128.md?page=2)
