1
install.packages('RSQLite', repos='http://cran.us.r-project.org')
Installing package into ‘C:/Users/Ajmal/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)

  There is a binary version available but the source version is later:
        binary source needs_compilation
RSQLite  2.2.7  2.2.8              TRUE

installing the source package ‘RSQLite’

trying URL 'http://cran.us.r-project.org/src/contrib/RSQLite_2.2.8.tar.gz'
Content type 'application/x-gzip' length 3628717 bytes (3.5 MB)
downloaded 3.5 MB

* installing *source* package 'RSQLite' ...
** package 'RSQLite' successfully unpacked and MD5 sums checked
** using staged installation
** libs

*** arch - i386
C:/Rtools/mingw_32/bin/g++  -I"C:/Users/Ajmal/DOCUME~1/R/R-36~1.0/include" -DNDEBUG -I. -Ivendor -DRSQLITE_USE_BUNDLED_SQLITE -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_STAT4 -DSQLITE_SOUNDEX -DRCPP_DEFAULT_INCLUDE_CALL=false -DRCPP_USING_UTF8_ERROR_STRING -DBOOST_NO_AUTO_PTR -DSQLITE_MAX_LENGTH=2147483647 -DHAVE_USLEEP=1 -I"C:/Users/Ajmal/Documents/R/R-3.6.0/library/plogr/include" -I"C:/Users/Ajmal/Documents/R/win-library/3.6/Rcpp/include"        -O2 -Wall  -mtune=generic -c DbColumn.cpp -o DbColumn.o
C:/Rtools/mingw_32/bin/g++  -I"C:/Users/Ajmal/DOCUME~1/R/R-36~1.0/include" -DNDEBUG -I. -Ivendor -DRSQLITE_USE_BUNDLED_SQLITE -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_STAT4 -DSQLITE_SOUNDEX -DRCPP_DEFAULT_INCLUDE_CALL=false -DRCPP_USING_UTF8_ERROR_STRING -DBOOST_NO_AUTO_PTR -DSQLITE_MAX_LENGTH=2147483647 -DHAVE_USLEEP=1 -I"C:/Users/Ajmal/Documents/R/R-3.6.0/library/plogr/include" -I"C:/Users/Ajmal/Documents/R/win-library/3.6/Rcpp/include"        -O2 -Wall  -mtune=generic -c DbColumnDataSource.cpp -o DbColumnDataSource.o
C:/Rtools/mingw_32/bin/g++  -I"C:/Users/Ajmal/DOCUME~1/R/R-36~1.0/include" -DNDEBUG -I. -Ivendor -DRSQLITE_USE_BUNDLED_SQLITE -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_STAT4 -DSQLITE_SOUNDEX -DRCPP_DEFAULT_INCLUDE_CALL=false -DRCPP_USING_UTF8_ERROR_STRING -DBOOST_NO_AUTO_PTR -DSQLITE_MAX_LENGTH=2147483647 -DHAVE_USLEEP=1 -I"C:/Users/Ajmal/Documents/R/R-3.6.0/library/plogr/include" -I"C:/Users/Ajmal/Documents/R/win-library/3.6/Rcpp/include"        -O2 -Wall  -mtune=generic -c DbColumnDataSourceFactory.cpp -o DbColumnDataSourceFactory.o
C:/Rtools/mingw_32/bin/g++  -I"C:/Users/Ajmal/DOCUME~1/R/R-36~1.0/include" -DNDEBUG -I. -Ivendor -DRSQLITE_USE_BUNDLED_SQLITE -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_STAT4 -DSQLITE_SOUNDEX -DRCPP_DEFAULT_INCLUDE_CALL=false -DRCPP_USING_UTF8_ERROR_STRING -DBOOST_NO_AUTO_PTR -DSQLITE_MAX_LENGTH=2147483647 -DHAVE_USLEEP=1 -I"C:/Users/Ajmal/Documents/R/R-3.6.0/library/plogr/include" -I"C:/Users/Ajmal/Documents/R/win-library/3.6/Rcpp/include"        -O2 -Wall  -mtune=generic -c DbColumnStorage.cpp -o DbColumnStorage.o
C:/Rtools/mingw_32/bin/g++  -I"C:/Users/Ajmal/DOCUME~1/R/R-36~1.0/include" -DNDEBUG -I. -Ivendor -DRSQLITE_USE_BUNDLED_SQLITE -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_STAT4 -DSQLITE_SOUNDEX -DRCPP_DEFAULT_INCLUDE_CALL=false -DRCPP_USING_UTF8_ERROR_STRING -DBOOST_NO_AUTO_PTR -DSQLITE_MAX_LENGTH=2147483647 -DHAVE_USLEEP=1 -I"C:/Users/Ajmal/Documents/R/R-3.6.0/library/plogr/include" -I"C:/Users/Ajmal/Documents/R/win-library/3.6/Rcpp/include"        -O2 -Wall  -mtune=generic -c DbConnection.cpp -o DbConnection.o
C:/Rtools/mingw_32/bin/g++  -I"C:/Users/Ajmal/DOCUME~1/R/R-36~1.0/include" -DNDEBUG -I. -Ivendor -DRSQLITE_USE_BUNDLED_SQLITE -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_STAT4 -DSQLITE_SOUNDEX -DRCPP_DEFAULT_INCLUDE_CALL=false -DRCPP_USING_UTF8_ERROR_STRING -DBOOST_NO_AUTO_PTR -DSQLITE_MAX_LENGTH=2147483647 -DHAVE_USLEEP=1 -I"C:/Users/Ajmal/Documents/R/R-3.6.0/library/plogr/include" -I"C:/Users/Ajmal/Documents/R/win-library/3.6/Rcpp/include"        -O2 -Wall  -mtune=generic -c DbDataFrame.cpp -o DbDataFrame.o
In file included from vendor/boost/bind.hpp:29:0,
                 from DbDataFrame.cpp:7:
vendor/boost/bind/bind.hpp:1428:40: fatal error: boost/bind/bind_template.hpp: No such file or directory
 #include <boost/bind/bind_template.hpp>
                                        ^
compilation terminated.
make: *** [C:/Users/Ajmal/DOCUME~1/R/R-36~1.0/etc/i386/Makeconf:215: DbDataFrame.o] Error 1

Ending the the error:

ERROR: compilation failed for package 'RSQLite' removing 'C:/Users/Ajmal/Documents/R/win-library/3.6/RSQLite' Warning in install.packages : installation of package ‘RSQLite’ had non-zero exit status

xilliam
  • 2,074
  • 2
  • 15
  • 27
  • Upgrade R to the latest version. – G. Grothendieck Oct 02 '21 at 02:17
  • 1
    Try `install.packages('RSQLite', repos='http://cran.us.r-project.org', type="binary")` It easier to avoid building from source if you can help it. – MrFlick Oct 02 '21 at 03:28
  • @G.Grothendieck while I have no doubt that that is a good recommendation in general, do you know why a header file which is (supposed to be) included in the source package is not found? That doesn't seem like an "R" thing, do you think this is a `g++` thing, and therefore in addition to updating R, the OP will need to update Rtools? – r2evans Oct 13 '21 at 12:55
  • @G.Grothendieck Sure, but the header in the error is `boost/bind/bind_template.hpp` is referenced in `vendor/boost/bind/bind.hpp`, which is in the [RSQLite source](https://github.com/r-dbi/RSQLite/tree/main/src/vendor/boost), not in R's installation. I would more-likely think that this might be a conflict in Makevars or something else that *is* R-version dependent, due to the change in compilers (from R-3 to R-4). – r2evans Oct 13 '21 at 16:52
  • AJMAL MUHAMMAD A, is it correct to infer that you have Rtools4 installed? If so, then it is not fully compatible with your version of R (3.6). As shown on the [Rtools page](https://cran.r-project.org/bin/windows/Rtools/), Rtools4 is for R-4.0.0 and newer; you need Rtools35 (https://cran.r-project.org/bin/windows/Rtools/history.html) which covers R versions 3.3 through 3.6 (i.e., *your* version of R). – r2evans Oct 13 '21 at 16:55
  • (I may easily be wrong, I'm not 100% certain of the subdirs of each Rtools installation.) – r2evans Oct 13 '21 at 16:56

1 Answers1

0

I ran into the same compilation errors as you described, on R 4.1.3.

You probably need to install boost development files. On debian/ubuntu,

sudo apt install libboost-dev

Then, RSQLite compiles and installs fine for me.

ning
  • 1,823
  • 1
  • 19
  • 25