diff --git a/src/Makevars b/src/Makevars
index 96f0804..f5313ff 100644
--- a/src/Makevars
+++ b/src/Makevars
@@ -2,6 +2,7 @@ CXX_STD = CXX17
     
 PKG_CPPFLAGS =-DBOOST_NO_AUTO_PTR -w -Wfatal-errors
 PKG_LIBS = `${R_HOME}/bin/Rscript -e "cytolib:::cytolib_LdFlags()"`  
+PKG_CXXFLAGS = -D_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION
 
 .PHONY: all clean 
 
