When I try to install writexl in R 3.5.2, I get a compilation error. I noticed that another issue (#21) describes problems with compilation that may have been related to compilation flags, but with no clear resolution. My compilation error is not the same as in that issue, however.
trying URL 'https://cran.r-project.org/src/contrib/writexl_1.1.tar.gz'
Content type 'application/x-gzip' length 209069 bytes (204 KB)
==================================================
downloaded 204 KB
* installing *source* package ‘writexl’ ...
** package ‘writexl’ successfully unpacked and MD5 sums checked
** libs
rm -f writexl.so libxlsxwriter/libstatxlsxwriter.a write_xlsx.o libxlsxwriter/app.o libxlsxwriter/format.o libxlsxwriter/theme.o libxlsxwriter/chart.o libxlsxwriter/hash_table.o libxlsxwriter/utility.o libxlsxwriter/content_types.o libxlsxwriter/packager.o libxlsxwriter/workbook.o libxlsxwriter/core.o libxlsxwriter/relationships.o libxlsxwriter/worksheet.o libxlsxwriter/custom.o libxlsxwriter/shared_strings.o libxlsxwriter/xmlwriter.o libxlsxwriter/drawing.o libxlsxwriter/styles.o tmpfileplus/tmpfileplus.o libxlsxwriter/chartsheet.o minizip/ioapi.o minizip/zip.o
/usr/bin/gcc -I"/home/viking/.Renv/versions/3.5.2/lib64/R/include" -DNDEBUG -Iinclude -DNOCRYPT -DNOUNCRYPT -I'/home/viking/.Renv/versions/3.5.2/include' -fvisibility=hidden -fpic -g -O2 -c write_xlsx.c -o write_xlsx.o
/usr/bin/gcc -I"/home/viking/.Renv/versions/3.5.2/lib64/R/include" -DNDEBUG -Iinclude -DNOCRYPT -DNOUNCRYPT -I'/home/viking/.Renv/versions/3.5.2/include' -fvisibility=hidden -fpic -g -O2 -c libxlsxwriter/app.c -o libxlsxwriter/app.o
/usr/bin/gcc -I"/home/viking/.Renv/versions/3.5.2/lib64/R/include" -DNDEBUG -Iinclude -DNOCRYPT -DNOUNCRYPT -I'/home/viking/.Renv/versions/3.5.2/include' -fvisibility=hidden -fpic -g -O2 -c libxlsxwriter/format.c -o libxlsxwriter/format.o
/usr/bin/gcc -I"/home/viking/.Renv/versions/3.5.2/lib64/R/include" -DNDEBUG -Iinclude -DNOCRYPT -DNOUNCRYPT -I'/home/viking/.Renv/versions/3.5.2/include' -fvisibility=hidden -fpic -g -O2 -c libxlsxwriter/theme.c -o libxlsxwriter/theme.o
/usr/bin/gcc -I"/home/viking/.Renv/versions/3.5.2/lib64/R/include" -DNDEBUG -Iinclude -DNOCRYPT -DNOUNCRYPT -I'/home/viking/.Renv/versions/3.5.2/include' -fvisibility=hidden -fpic -g -O2 -c libxlsxwriter/chart.c -o libxlsxwriter/chart.o
/usr/bin/gcc -I"/home/viking/.Renv/versions/3.5.2/lib64/R/include" -DNDEBUG -Iinclude -DNOCRYPT -DNOUNCRYPT -I'/home/viking/.Renv/versions/3.5.2/include' -fvisibility=hidden -fpic -g -O2 -c libxlsxwriter/hash_table.c -o libxlsxwriter/hash_table.o
/usr/bin/gcc -I"/home/viking/.Renv/versions/3.5.2/lib64/R/include" -DNDEBUG -Iinclude -DNOCRYPT -DNOUNCRYPT -I'/home/viking/.Renv/versions/3.5.2/include' -fvisibility=hidden -fpic -g -O2 -c libxlsxwriter/utility.c -o libxlsxwriter/utility.o
/usr/bin/gcc -I"/home/viking/.Renv/versions/3.5.2/lib64/R/include" -DNDEBUG -Iinclude -DNOCRYPT -DNOUNCRYPT -I'/home/viking/.Renv/versions/3.5.2/include' -fvisibility=hidden -fpic -g -O2 -c libxlsxwriter/content_types.c -o libxlsxwriter/content_types.o
/usr/bin/gcc -I"/home/viking/.Renv/versions/3.5.2/lib64/R/include" -DNDEBUG -Iinclude -DNOCRYPT -DNOUNCRYPT -I'/home/viking/.Renv/versions/3.5.2/include' -fvisibility=hidden -fpic -g -O2 -c libxlsxwriter/packager.c -o libxlsxwriter/packager.o
In file included from include/xlsxwriter/third_party/zip.h:59:0,
from include/xlsxwriter/packager.h:17,
from libxlsxwriter/packager.c:11:
include/xlsxwriter/third_party/ioapi.h:141:51: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode));
^~
include/xlsxwriter/third_party/ioapi.h:142:51: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size));
^~
include/xlsxwriter/third_party/ioapi.h:143:51: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size));
^~
include/xlsxwriter/third_party/ioapi.h:144:51: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream));
^~
include/xlsxwriter/third_party/ioapi.h:145:51: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream));
^~
include/xlsxwriter/third_party/ioapi.h:147:51: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
typedef long (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream));
^~
include/xlsxwriter/third_party/ioapi.h:148:51: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
typedef long (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin));
^~
include/xlsxwriter/third_party/ioapi.h:154:5: error: unknown type name ‘open_file_func’
open_file_func zopen_file;
^~~~~~~~~~~~~~
include/xlsxwriter/third_party/ioapi.h:155:5: error: unknown type name ‘read_file_func’
read_file_func zread_file;
^~~~~~~~~~~~~~
include/xlsxwriter/third_party/ioapi.h:156:5: error: unknown type name ‘write_file_func’
write_file_func zwrite_file;
^~~~~~~~~~~~~~~
include/xlsxwriter/third_party/ioapi.h:157:5: error: unknown type name ‘tell_file_func’
tell_file_func ztell_file;
^~~~~~~~~~~~~~
include/xlsxwriter/third_party/ioapi.h:158:5: error: unknown type name ‘seek_file_func’
seek_file_func zseek_file;
^~~~~~~~~~~~~~
include/xlsxwriter/third_party/ioapi.h:159:5: error: unknown type name ‘close_file_func’
close_file_func zclose_file;
^~~~~~~~~~~~~~~
include/xlsxwriter/third_party/ioapi.h:160:5: error: unknown type name ‘testerror_file_func’
testerror_file_func zerror_file;
^~~~~~~~~~~~~~~~~~~
include/xlsxwriter/third_party/ioapi.h:164:51: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
typedef ZPOS64_T (ZCALLBACK *tell64_file_func) OF((voidpf opaque, voidpf stream));
^~
include/xlsxwriter/third_party/ioapi.h:165:51: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
typedef long (ZCALLBACK *seek64_file_func) OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin));
^~
include/xlsxwriter/third_party/ioapi.h:166:51: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
typedef voidpf (ZCALLBACK *open64_file_func) OF((voidpf opaque, const void* filename, int mode));
^~
include/xlsxwriter/third_party/ioapi.h:170:5: error: unknown type name ‘open64_file_func’
open64_file_func zopen64_file;
^~~~~~~~~~~~~~~~
include/xlsxwriter/third_party/ioapi.h:171:5: error: unknown type name ‘read_file_func’
read_file_func zread_file;
^~~~~~~~~~~~~~
include/xlsxwriter/third_party/ioapi.h:172:5: error: unknown type name ‘write_file_func’
write_file_func zwrite_file;
^~~~~~~~~~~~~~~
include/xlsxwriter/third_party/ioapi.h:173:5: error: unknown type name ‘tell64_file_func’
tell64_file_func ztell64_file;
^~~~~~~~~~~~~~~~
include/xlsxwriter/third_party/ioapi.h:174:5: error: unknown type name ‘seek64_file_func’
seek64_file_func zseek64_file;
^~~~~~~~~~~~~~~~
include/xlsxwriter/third_party/ioapi.h:175:5: error: unknown type name ‘close_file_func’
close_file_func zclose_file;
^~~~~~~~~~~~~~~
include/xlsxwriter/third_party/ioapi.h:176:5: error: unknown type name ‘testerror_file_func’
testerror_file_func zerror_file;
^~~~~~~~~~~~~~~~~~~
include/xlsxwriter/third_party/ioapi.h:180:28: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
void fill_fopen64_filefunc OF((zlib_filefunc64_def* pzlib_filefunc_def));
^~
include/xlsxwriter/third_party/ioapi.h:181:26: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def));
^~
include/xlsxwriter/third_party/ioapi.h:187:5: error: unknown type name ‘open_file_func’
open_file_func zopen32_file;
^~~~~~~~~~~~~~
include/xlsxwriter/third_party/ioapi.h:188:5: error: unknown type name ‘tell_file_func’
tell_file_func ztell32_file;
^~~~~~~~~~~~~~
include/xlsxwriter/third_party/ioapi.h:189:5: error: unknown type name ‘seek_file_func’
seek_file_func zseek32_file;
^~~~~~~~~~~~~~
include/xlsxwriter/third_party/ioapi.h:200:21: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
voidpf call_zopen64 OF((const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode));
^~
include/xlsxwriter/third_party/ioapi.h:201:22: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
long call_zseek64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin));
^~
include/xlsxwriter/third_party/ioapi.h:202:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
ZPOS64_T call_ztell64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream));
^~
In file included from include/xlsxwriter/packager.h:17:0,
from libxlsxwriter/packager.c:11:
include/xlsxwriter/third_party/zip.h:129:32: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
extern zipFile ZEXPORT zipOpen OF((const char *pathname, int append));
^~
include/xlsxwriter/third_party/zip.h:130:34: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
extern zipFile ZEXPORT zipOpen64 OF((const void *pathname, int append));
^~
include/xlsxwriter/third_party/zip.h:150:33: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
extern zipFile ZEXPORT zipOpen2 OF((const char *pathname,
^~
include/xlsxwriter/third_party/zip.h:155:36: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
extern zipFile ZEXPORT zipOpen2_64 OF((const void *pathname,
^~
include/xlsxwriter/third_party/zip.h:160:40: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file,
^~
include/xlsxwriter/third_party/zip.h:171:42: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
extern int ZEXPORT zipOpenNewFileInZip64 OF((zipFile file,
^~
include/xlsxwriter/third_party/zip.h:200:41: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
extern int ZEXPORT zipOpenNewFileInZip2 OF((zipFile file,
^~
include/xlsxwriter/third_party/zip.h:213:44: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
extern int ZEXPORT zipOpenNewFileInZip2_64 OF((zipFile file,
^~
include/xlsxwriter/third_party/zip.h:229:41: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
extern int ZEXPORT zipOpenNewFileInZip3 OF((zipFile file,
^~
include/xlsxwriter/third_party/zip.h:246:44: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
extern int ZEXPORT zipOpenNewFileInZip3_64 OF((zipFile file,
^~
include/xlsxwriter/third_party/zip.h:272:41: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
extern int ZEXPORT zipOpenNewFileInZip4 OF((zipFile file,
^~
include/xlsxwriter/third_party/zip.h:293:44: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
extern int ZEXPORT zipOpenNewFileInZip4_64 OF((zipFile file,
^~
include/xlsxwriter/third_party/zip.h:320:40: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
extern int ZEXPORT zipWriteInFileInZip OF((zipFile file,
^~
include/xlsxwriter/third_party/zip.h:327:38: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
extern int ZEXPORT zipCloseFileInZip OF((zipFile file));
^~
include/xlsxwriter/third_party/zip.h:332:41: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
extern int ZEXPORT zipCloseFileInZipRaw OF((zipFile file,
^~
include/xlsxwriter/third_party/zip.h:336:43: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
extern int ZEXPORT zipCloseFileInZipRaw64 OF((zipFile file,
^~
include/xlsxwriter/third_party/zip.h:346:29: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
extern int ZEXPORT zipClose OF((zipFile file,
^~
include/xlsxwriter/third_party/zip.h:353:44: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
extern int ZEXPORT zipRemoveExtraInfoBlock OF((char* pData, int* dataLen, short sHeader));
^~
libxlsxwriter/packager.c: In function ‘lxw_packager_new’:
libxlsxwriter/packager.c:108:25: warning: implicit declaration of function ‘zipOpen’; did you mean ‘popen’? [-Wimplicit-function-declaration]
packager->zipfile = zipOpen(packager->filename, 0);
^~~~~~~
popen
libxlsxwriter/packager.c:108:23: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
packager->zipfile = zipOpen(packager->filename, 0);
^
libxlsxwriter/packager.c: In function ‘_add_file_to_zip’:
libxlsxwriter/packager.c:1021:13: warning: implicit declaration of function ‘zipOpenNewFileInZip4_64’ [-Wimplicit-function-declaration]
error = zipOpenNewFileInZip4_64(self->zipfile,
^~~~~~~~~~~~~~~~~~~~~~~
libxlsxwriter/packager.c:1048:17: warning: implicit declaration of function ‘zipWriteInFileInZip’ [-Wimplicit-function-declaration]
error = zipWriteInFileInZip(self->zipfile,
^~~~~~~~~~~~~~~~~~~
libxlsxwriter/packager.c:1063:17: warning: implicit declaration of function ‘zipCloseFileInZip’ [-Wimplicit-function-declaration]
error = zipCloseFileInZip(self->zipfile);
^~~~~~~~~~~~~~~~~
libxlsxwriter/packager.c: In function ‘lxw_create_package’:
libxlsxwriter/packager.c:1177:17: warning: implicit declaration of function ‘zipClose’; did you mean ‘pclose’? [-Wimplicit-function-declaration]
zip_error = zipClose(self->zipfile, NULL);
^~~~~~~~
pclose
make: *** [/home/viking/.Renv/versions/3.5.2/lib64/R/etc/Makeconf:162: libxlsxwriter/packager.o] Error 1
ERROR: compilation failed for package ‘writexl’
* removing ‘/home/viking/.Renv/versions/3.5.2/lib64/R/library/writexl’
The downloaded source packages are in
‘/tmp/Rtmp7dBQJ8/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("writexl", repos = "https://cran.r-project.org") :
installation of package ‘writexl’ had non-zero exit status