diff --git a/src/library/grDevices/src/Makefile.win b/src/library/grDevices/src/Makefile.win index b2c068f3c62..769cdb75cd8 100644 --- a/src/library/grDevices/src/Makefile.win +++ b/src/library/grDevices/src/Makefile.win @@ -27,7 +27,8 @@ PKG_CPPFLAGS = -I$(R_HOME)/src/include -DHAVE_CONFIG_H devPS-CPPFLAGS = -I"$(EXT_LIBS)/include" -I$(R_HOME)/src/gnuwin32 ## devWindows needs opt.h, console.h, rui.h and graphapp headers -arch_DEFS = -DR_ARCH='"$(R_ARCH)"' +## remove slash to avoid Msys2 path conversion +arch_DEFS = -DR_ARCH='"$(subst /,,$(R_ARCH))"' devWindows-CPPFLAGS = -I$(R_HOME)/src/gnuwin32 -I$(R_HOME)/src/extra $(arch_DEFS) winbitmap-CPPFLAGS = -DHAVE_PNG -DHAVE_JPEG -DHAVE_TIFF -I"$(EXT_LIBS)/include" diff --git a/src/library/grDevices/src/devWindows.c b/src/library/grDevices/src/devWindows.c index b6216c4ffd3..58c84e4be15 100644 --- a/src/library/grDevices/src/devWindows.c +++ b/src/library/grDevices/src/devWindows.c @@ -3951,7 +3951,7 @@ static int Load_Rcairo_Dll() { if (!RcairoAlreadyLoaded) { size_t needed = strlen(R_HomeDir()) - + strlen("/library/grDevices/libs") + + strlen("/library/grDevices/libs/") + strlen(R_ARCH) + strlen("/winCairo.dll") + 1; char *szFullPath = malloc(needed); @@ -3960,7 +3960,7 @@ static int Load_Rcairo_Dll() return -1; } strcpy(szFullPath, R_HomeDir()); - strcat(szFullPath, "/library/grDevices/libs"); + strcat(szFullPath, "/library/grDevices/libs/"); strcat(szFullPath, R_ARCH); strcat(szFullPath, "/winCairo.dll"); if (((hRcairoDll = LoadLibrary(szFullPath)) != NULL) &&