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.
What operating system and compiler are you using?
I used MSVS compiler in Windows 10.
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’
What version of msvc is it?
It’s 2017. I’m wondering whether it is compatible with windows 10 and SDK 10.
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…
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.
When you open visual studio and under help, look at the ‘About Visual Studio’ and send me the version (something like 15.5.0)
It’s 15.7.4. Please check out the snapshot of the information.
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.
Thanks, looking forward to your updates.
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?
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
The log is attached below, I built it in Qt.
Can you try checking the C++/CLI support option?
This is what I have installed on my system.
I’m modifying the visual studio installation, and will see if it works or not.
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.
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
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…
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.
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