x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

C4577: 'noexcept' used with no exception handling mode specified; termination on exception is not guaranteed. Specify /EHsc

I'm getting the following build error when I'm trying to package my game:

 Error C4577: 'noexcept' used with no exception handling mode specified; termination on exception is not guaranteed. Specify /EHsc

These errors originate from the Boost library that I'm trying to build with my project, and the errors happen everywhere that they use their "BOOST_SYSTEM_NOEXCEPT" macro. These errors only occur when packaging, if I build in Development_Editor I don't see these errors.

Is there a way I can fix these errors? How can I specify the /EHsc flag?

NOTE: Answers below will depend heavily on engine version, try many of them before you give up!

Product Version: UE 4.10
Tags:
more ▼

asked Dec 16 '15 at 06:44 PM in Packaging & Deployment

avatar image

janimationd
427 20 96 123

avatar image rabellogp Dec 27 '15 at 12:51 PM

Did you find a solution yet? I'm also getting the same error here, can't find a way out...

avatar image janimationd Dec 28 '15 at 09:14 PM

yep, check my answer below

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

8 answers: sort voted first

I think the better solution here is to add the following to your build.cs file:

 Definitions.Add("BOOST_SYSTEM_NOEXCEPT");

So that Boost will not insert "noexcept" everywhere, that way you don't have to force enable exceptions for all modules.

more ▼

answered Aug 10 '17 at 08:29 AM

avatar image

tobiasmollstam
36 2 6

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

I fixed this by adding

 UEBuildConfiguration.bForceEnableExceptions = true;

To my build.cs file.

more ▼

answered Dec 28 '15 at 09:14 PM

avatar image

janimationd
427 20 96 123

avatar image Bumbala Jan 13 '16 at 08:32 PM

Thanks this saved my day.

avatar image Arthur Khusnutdinov Aug 10 '16 at 05:03 PM

Thank you!

avatar image Iohoilpotere Jan 26 '18 at 03:24 PM

Hi,

what if i have a bp project and not a c++ project? Where would i find build.cs? Please, i'm trying to package with a plugin which implements boost,

Thank you!

avatar image TTimo Feb 26 '18 at 05:34 PM

This is readonly now (4.17), so it can't be done this way anymore. I followed RCL's suggestion of hacking out UnrealBuildTool.exe instead, see https://answers.unrealengine.com/questions/51798/how-can-i-enable-unwind-semantics-for-c-style-exce.html

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

In 4.19.2 none of the above answers will fix this issue if you build in shipping mode on Visual Studios 17.

In order to fix this, you must add a line to Engine/Source/Programs/UnrealBuildTool/Platform/Windows/VCToolChain.cs inside the function AppendCLArguments_Global:

         Arguments.Add("/EHsc");

This line will handle the compiler exception and you should be good to go! :D

more ▼

answered Jun 15 '18 at 05:47 PM

avatar image

Samlsewall
172 5 9 10

avatar image hughroberts Jun 15 '18 at 09:32 PM

Actually, the solution is slightly easier and you don't need to modify the global toolchain file. See my answer below.

avatar image Samlsewall Jun 15 '18 at 09:47 PM

Funny you should mention that. I tried that. It doesn't work in 4.19.2 when you have visual studios 2017. :/ Hence the adding of the compiler argument into the toolchain.

avatar image hughroberts Jun 15 '18 at 09:57 PM

I have VS 2017 of course! So it's weird that this doesn't work for you?

avatar image Samlsewall Jun 15 '18 at 10:00 PM

Odd! Have you tried running a shipping build? Because your solution works fine until you build shipping, at which point it produces the error.

avatar image Ryan Darcey Jun 30 '18 at 04:03 AM

This is actually the only thing that worked for me! I'm on 4.18.2 and using Visual Studio 2017. I think it matters which version of Visual Studio 2017 you're using cause my PC has it installed and this issue only pops up on my laptop, which has newer version.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

I had the same error but for the WFMedia module ONLY for client builds. What I did was added:

 bEnableExceptions = true;


Into the Build file for that module only when building for windows. This fixed the build.

more ▼

answered May 10 '18 at 01:05 AM

avatar image

Zeetu
46 1 4

avatar image FortsFury May 16 '18 at 03:46 PM

Thank you!!!!! I've rebuilt several times and even tried disabling the WFMedia plugin.. no idea why it's throwing build errors about that.

avatar image anteevy Jun 04 '18 at 05:28 PM

Strangely this didn't work for me on 4.19. I just removed the WFMedia plugin folder and now it builds though.

avatar image LemonInGintonic Jul 14 '18 at 05:15 PM

Where did you find this folder? I can see only Wmfedia folder but no WFMedia.

avatar image anteevy Jul 15 '18 at 02:50 PM

Engine/Plugins/Media/WmfMedia :) The above was a typo, sorry.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

For Unreal 4.18 in the [ProjectName].Build.cs file, the constructor parameter is now ReadOnlyTarget rules and I got an error using: bForceEnableExceptions = true;
I made it work by editing [ProjectName].Target.cs in the directory above. Adding bForceEnableExceptions = true; there fixed my build so I could use exceptions.

more ▼

answered Mar 15 '18 at 12:00 AM

avatar image

charliefitch
31 3

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Updating my Visual Studio for the 4.20 engine caused my 4.19 projects to break with this error. I tried all of the solutions, and none of them worked for me.

Searching on Discord, I found a post from Joshua who said: Removing Wmfmedia plugin completely fixed it.

This worked. Thanks Joshua!

more ▼

answered Jul 26 '18 at 10:11 PM

avatar image

edcolmar
120 6 13 20

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

In 4.19.2, the probably best way to do this is in the MyProject.Build.cs file, just by adding bEnableExceptions = true;. But yea it is completely non-obvious and it took me hours to find a solution that works... But I think this is the one to go, as no global toolchain files have to be modified.

 using UnrealBuildTool;
 public class MyProject : ModuleRules
 {
 public MyProject(ReadOnlyTargetRules Target) : base(Target)
 {
     PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
             bEnableExceptions = true; // Add this...

     PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "HeadMountedDisplay" });
 }
 }
more ▼

answered Jun 15 '18 at 09:31 PM

avatar image

hughroberts
6 1 1

avatar image PlainBane Sep 20 '18 at 06:43 AM

This worked for me on UE 4.20.2 ,Visual Studio 2017 14.15.26726 toolchain.

avatar image Stefan Lundmark Mar 25 '19 at 03:38 PM

This didn't work for me in 4.16.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

This doesn't help at all.

more ▼

answered May 27 '18 at 01:43 PM

avatar image

poke1103
20 1 6 17

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question