omegahat/RDCOMClient

Build error with R 3.3.3 and Rtools 3.4

Closed this issue · 2 comments

Hello,

I attempted to install it from source and received the following error. (I also get the same output and error if I use devtools::install_github)

I am using the current version of R (3.3.3) and the current version of Rtools (version 3.4.0.1962) on Windows 7.


R version 3.3.3 (2017-03-06) -- "Another Canoe"
Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> install.packages("RDCOMClient", repos = "http://www.omegahat.net/R")
Installing package into ‘C:/Users/kalinowskit/Documents/R/win-library/3.3’
(as ‘lib’ is unspecified)
Warning in install.packages :
  cannot open URL 'http://www.omegahat.net/R/bin/windows/contrib/3.3/PACKAGES.gz': HTTP status was '404 Not Found'
Warning in install.packages :
  cannot open URL 'http://www.omegahat.net/R/bin/windows/contrib/3.3/PACKAGES': HTTP status was '404 Not Found'
Warning in install.packages :
  unable to access index for repository http://www.omegahat.net/R/bin/windows/contrib/3.3:
  cannot open URL 'http://www.omegahat.net/R/bin/windows/contrib/3.3/PACKAGES'
Package which is only available in source form, and may need compilation of
  C/C++/Fortran: ‘RDCOMClient’
Do you want to attempt to install these from sources?
y/n: y
installing the source package ‘RDCOMClient’

trying URL 'http://www.omegahat.net/R/src/contrib/RDCOMClient_0.93-0.tar.gz'
Content type 'application/x-gzip' length 49509 bytes (48 KB)
downloaded 48 KB

* installing *source* package 'RDCOMClient' ...
** libs

*** arch - i386
c:/Rtools/mingw_32/bin/g++  -I"C:/PROGRA~1/R/R-33~1.3/include" -DNDEBUG -D_GNU_ -DNO_PYCOM_IPROVIDECLASSINFO -I.    -I"d:/Compiler/gcc-4.9.3/local330/include"  -Wno-deprecated    -O2 -Wall  -mtune=core2 -c COMError.cpp -o COMError.o
COMError.cpp:347:0: warning: "_countof" redefined
 #define _countof(array) (sizeof(array)/sizeof(array[0]))
 ^
In file included from C:/Rtools/mingw_32/i686-w64-mingw32/include/combaseapi.h:129:0,
                 from C:/Rtools/mingw_32/i686-w64-mingw32/include/objbase.h:14,
                 from C:/Rtools/mingw_32/i686-w64-mingw32/include/ole2.h:17,
                 from C:/Rtools/mingw_32/i686-w64-mingw32/include/wtypes.h:12,
                 from C:/Rtools/mingw_32/i686-w64-mingw32/include/winscard.h:10,
                 from C:/Rtools/mingw_32/i686-w64-mingw32/include/windows.h:97,
                 from RCOMObject.h:23,
                 from COMError.cpp:1:
C:/Rtools/mingw_32/i686-w64-mingw32/include/stdlib.h:299:0: note: this is the location of the previous definition
 #define _countof(_Array) sizeof(*__countof_helper(_Array))
 ^
In file included from COMError.cpp:1:0:
RCOMObject.h: In member function 'virtual ULONG RCOMObject::Release()':
RCOMObject.h:61:50: warning: deleting object of abstract class type 'RCOMObject' which has non-virtual destructor will cause undefined behaviour [-Wdelete-non-virtual-dtor]
                                           delete this;
                                                  ^
COMError.cpp: In function 'void GetScodeString(HRESULT, LPTSTR, int)':
COMError.cpp:371:39: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'HRESULT {aka long int}' [-Wformat=]
  sprintf(buf, ("OLE error 0x%08x"), hr);
                                       ^
COMError.cpp: In function 'HRESULT checkErrorInfo(IUnknown*, HRESULT, SEXPREC**)':
COMError.cpp:409:51: warning: format '%X' expects argument of type 'unsigned int', but argument 3 has type 'HRESULT {aka long int}' [-Wformat=]
   fprintf(stderr, "<checkErrorInfo> %X \n", status);
                                                   ^
c:/Rtools/mingw_32/bin/gcc  -I"C:/PROGRA~1/R/R-33~1.3/include" -DNDEBUG -D_GNU_ -DNO_PYCOM_IPROVIDECLASSINFO -I.    -I"d:/Compiler/gcc-4.9.3/local330/include"     -O3 -Wall  -std=gnu99 -mtune=core2 -c RUtils.c -o RUtils.o
c:/Rtools/mingw_32/bin/g++  -I"C:/PROGRA~1/R/R-33~1.3/include" -DNDEBUG -D_GNU_ -DNO_PYCOM_IPROVIDECLASSINFO -I.    -I"d:/Compiler/gcc-4.9.3/local330/include"  -Wno-deprecated    -O2 -Wall  -mtune=core2 -c connect.cpp -o connect.o
connect.cpp: In function 'HRESULT R_getCOMArgs(SEXP, DISPPARAMS*, DISPID*, int, int*)':
connect.cpp:405:10: warning: variable 'hr' set but not used [-Wunused-but-set-variable]
  HRESULT hr;
          ^
c:/Rtools/mingw_32/bin/g++  -I"C:/PROGRA~1/R/R-33~1.3/include" -DNDEBUG -D_GNU_ -DNO_PYCOM_IPROVIDECLASSINFO -I.    -I"d:/Compiler/gcc-4.9.3/local330/include"  -Wno-deprecated    -O2 -Wall  -mtune=core2 -c converters.cpp -o converters.o
In file included from converters.cpp:1:0:
RCOMObject.h: In member function 'virtual ULONG RCOMObject::Release()':
RCOMObject.h:61:50: warning: deleting object of abstract class type 'RCOMObject' which has non-virtual destructor will cause undefined behaviour [-Wdelete-non-virtual-dtor]
                                           delete this;
                                                  ^
converters.cpp: In function 'SEXPREC* R_convertDCOMObjectToR(VARIANT*)':
converters.cpp:365:11: warning: variable 'hr' set but not used [-Wunused-but-set-variable]
   HRESULT hr;
           ^
c:/Rtools/mingw_32/bin/g++ -shared -s -static-libgcc -o RDCOMClient.dll tmp.def COMError.o RUtils.o connect.o converters.o -lole32 -loleaut32 -luuid -Ld:/Compiler/gcc-4.9.3/local330/lib/i386 -Ld:/Compiler/gcc-4.9.3/local330/lib -LC:/PROGRA~1/R/R-33~1.3/bin/i386 -lR
COMError.o:COMError.cpp:(.text+0x2b3): undefined reference to `vtable for RCOMObject'
COMError.o:COMError.cpp:(.text+0x4c3): undefined reference to `vtable for RCOMObject'
COMError.o:COMError.cpp:(.text$_ZN10RCOMObject7ReleaseEv+0x19): undefined reference to `vtable for RCOMObject'
converters.o:converters.cpp:(.text+0x175d): undefined reference to `vtable for RCOMObject'
collect2.exe: error: ld returned 1 exit status
no DLL was created
ERROR: compilation failed for package 'RDCOMClient'
* removing 'C:/Users/kalinowskit/Documents/R/win-library/3.3/RDCOMClient'
Warning in install.packages :
  running command '"C:/PROGRA~1/R/R-33~1.3/bin/x64/R" CMD INSTALL -l "C:\Users\kalinowskit\Documents\R\win-library\3.3" C:\Users\KALINO~1\AppData\Local\Temp\RtmpIFQgwd/downloaded_packages/RDCOMClient_0.93-0.tar.gz' had status 1
Warning in install.packages :
  installation of package ‘RDCOMClient’ had non-zero exit status

I'm not sure if this package is still maintained, it seems like it's been a few years since there were any modifications to the code. It would be a shame if this went away; while there is a hodgepodge of solutions on CRAN that make excel or other ms office files, I don't think they matches the power and flexibility of being able to control the computer through this interface...

I was able to download a prebuilt binary from by calling:

install.packages("RDCOMClient", repos = "http://www.stats.ox.ac.uk/pub/RWin/")

Perhaps I'm misunderstanding the requirements for building this package and it's not expected that it will build using Rtools 3.4 toolchain.

Thank you.

Is there a version of the RDCOMClient package available for Mac OS X El Capitan? Else what is the alternative?

Thanks

Amit Taneja