diff --git a/MaterialLib/FractureModels/MohrCoulomb.cpp b/MaterialLib/FractureModels/MohrCoulomb.cpp
index 48d24bb312bfa6bafc0baa38ee8c202a2ab12752..175be798f772e0654678c2d573d0c95a2b946f94 100644
--- a/MaterialLib/FractureModels/MohrCoulomb.cpp
+++ b/MaterialLib/FractureModels/MohrCoulomb.cpp
@@ -12,6 +12,10 @@
 #include "BaseLib/Error.h"
 #include "MathLib/MathTools.h"
 
+#ifndef Q_MOC_RUN // to avoid Qt4 bug, https://bugreports.qt.io/browse/QTBUG-22829
+#include <boost/math/special_functions/sign.hpp>
+#endif
+
 namespace MaterialLib
 {
 namespace Fracture
@@ -86,12 +90,12 @@ void MohrCoulomb<DisplacementDim>::computeConstitutiveRelation(
     }
 
     Eigen::VectorXd dFs_dS(2);
-    dFs_dS[0] = MathLib::sgn(sigma[0]);
+    dFs_dS[0] = boost::math::sign(sigma[0]);
     dFs_dS[1] = std::tan(mat.phi);
 
     // plastic potential function: Qs = |tau| + Sn * tan da
     Eigen::VectorXd dQs_dS(2);
-    dQs_dS[0] = MathLib::sgn(sigma[0]);
+    dQs_dS[0] = boost::math::sign(sigma[0]);
     dQs_dS[1] = std::tan(mat.psi);
 
     // plastic multiplier
diff --git a/MathLib/MathTools.h b/MathLib/MathTools.h
index 8d882e911e76f140b2042fa8bfd670ebbbbcc09b..e578be54451e0447bbd9aa198bf93c8c2c21140e 100644
--- a/MathLib/MathTools.h
+++ b/MathLib/MathTools.h
@@ -115,11 +115,6 @@ double sqrDist(const double* p0, const double* p1)
  */
 double getAngle (const double p0[3], const double p1[3], const double p2[3]);
 
-/// sign function
-template <typename T> int sgn(T val) {
-    return (T(0) < val) - (val < T(0));
-}
-
 /// converts the given degrees to radians
 inline double to_radians(double degrees) {
     return degrees*boost::math::constants::pi<double>()/180.;