# Including exprtk requires compiler setting /GR

**URL:** <https://forums.unrealengine.com/t/including-exprtk-requires-compiler-setting-gr/390448>\
**Category:** Platform & Builds\
**Tags:** c-build-fail, unreal-engine, question\
**Created:** [April 9, 2017, 10:49pm UTC](https://forums.unrealengine.com/t/including-exprtk-requires-compiler-setting-gr/390448 "2017-04-09T22:49:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roi\_Danton](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Roi\_Danton](https://forums.unrealengine.com/u/Roi_Danton)\
**Post date:** [April 9, 2017, 10:49pm UTC](https://forums.unrealengine.com/t/including-exprtk-requires-compiler-setting-gr/390448/1 "2017-04-09T22:49:37Z")

</div>

[ExprTk](https://github.com/ArashPartow/exprtk) is a lexer, parser and evaluator for equations. I’ve included it in my project and get two compiler errors.

First one is regarding the macro `verify` (used in UE4 and exprtk), which I could fix by renaming this macro in exprtk.

The second one is the problem: [C4541](https://msdn.microsoft.com/en-us/library/8kyye6db.aspx) in `ue_4.15\engine\source\runtime\coreuobject\public\Templates\Casts.h`, line 405:

- ‘dynamic\_cast’ used on polymorphic  
type ‘exprtk::lexer::token\_scanner’  
with /GR-; unpredictable behavior may  
result
- ‘dynamic\_cast’ used on polymorphic  
type ‘exprtk::details::expression\_node’  
with /GR-; unpredictable behavior may  
result

Is it a problem activating /GR for Unreal Engine?  
If no, how can I activate it within an Unreal project?

Or even better, can I avoid that Casts.h is used with exprtk?

---

<div class="post-metadata">

**Author:** ![rytill](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@rytill](https://forums.unrealengine.com/u/rytill)\
**Post date:** [January 30, 2018, 2:21pm UTC](https://forums.unrealengine.com/t/including-exprtk-requires-compiler-setting-gr/390448/2 "2018-01-30T14:21:54Z")

</div>

Did you ever find the solution to this problem? My team is having the same issue…

---

<div class="post-metadata">

**Author:** ![Roi\_Danton](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Roi\_Danton](https://forums.unrealengine.com/u/Roi_Danton)\
**Post date:** [February 1, 2018, 7:31am UTC](https://forums.unrealengine.com/t/including-exprtk-requires-compiler-setting-gr/390448/3 "2018-02-01T07:31:49Z")

</div>

Unfortunately not. I skipped using exprtk with UE4 atm. In my case I had only a dozen equations so it was ok to hardcode each formula into an own class and doing some string manipulation for certain conditions myself. It is ugly but still ok if you only have a handful of possible equations and conditions.
