r-lib / later

Schedule an R function or formula to run after a specified period of time.
https://r-lib.github.io/later
Other
137 stars 27 forks source link

Problem compiling with clang on Windows #177

Closed jeroen closed 1 year ago

jeroen commented 1 year ago

Testing with clang on arm64 on Windows we see:

** libs
using C compiler: 'clang version 16.0.5'
using C++ compiler: 'clang version 16.0.5'
clang++ -std=gnu++17  -I"C:/PROGRA~1/R/R-devel/include" -DNDEBUG -DSTRICT_R_HEADERS -I'C:/Users/jeroen/AppData/Local/R/win-library/4.4/Rcpp/include'   -I"/c/msys64/home/jeroen/aarch64-w64-mingw32.static.posix/include"     -O2 -Wall    -c RcppExports.cpp -o RcppExports.o
In file included from RcppExports.cpp:5:
In file included from C:/Users/jeroen/AppData/Local/R/win-library/4.4/Rcpp/include/Rcpp.h:38:
C:/Users/jeroen/AppData/Local/R/win-library/4.4/Rcpp/include/Rcpp/Environment.h:91:24: error: no matching function for call to 'R_lsInternal'
                return R_lsInternal( env, all ? TRUE : FALSE ) ;
                       ^~~~~~~~~~~~
C:/PROGRA~1/R/R-devel/include/Rinternals.h:533:6: note: candidate function not viable: no known conversion from 'int' to 'Rboolean' for 2nd argument
SEXP R_lsInternal(SEXP, Rboolean);
     ^
1 error generated.
make: *** [C:/PROGRA~1/R/R-devel/etc/Makeconf:289: RcppExports.o] Error 1
ERROR: compilation failed for package 'later'
* removing 'C:/Users/jeroen/AppData/Local/R/win-library/4.4/later'

Previous topics in https://github.com/RcppCore/Rcpp/issues/1148 and https://github.com/RcppCore/Rcpp/issues/897 suggest a likely issue is something is included that redefines TRUE, probably in your windows.h include: https://stackoverflow.com/a/5663743/318752