Skip to content

Require of gWidgetsRGtk2 fails: RGtk2.dll can't be found, but it's there

12 messages · Gabor Grothendieck, Brian Ripley, Janko Thyson +2 more

#
Dear list,

I've been trying to get gWidgets/gWidgetsRGtk2 to run every other month 
for a while, but somehow I simply can't figure out what's going wrong.

I tried several distributions of the GTK runtime environment for Windows 
(http://downloads.sourceforge.net/gladewin32/gtk-2.12.9-win32-1.exe as 
described in the package's vignette, 
http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.22/gtk+-bundle_2.22.1-20101227_win32.zip)

I also included GTK in my Windows PATH.

Yet, when I run 'require(gWidgetsRGtk2)', R complains that the RGtk2.dll 
can't be found/loaded (see below). But this file definitely exists. I'm 
running R-2.13.0 from a USB Device but made sure that args 'destdir' and 
'lib' are set propperly in 'install.packages'.

Loading required package: gWidgetsRGtk2
Loading required package: gWidgets
Error in inDL(x, as.logical(local), as.logical(now), ...) :
   unable to load shared object 
'R:/Apps/R/R-2.13.0/library/RGtk2/libs/i386/RGtk2.dll':
   LoadLibrary failure:  Das angegebene Modul wurde nicht gefunden.

Failed to load RGtk2 dynamic library, attempting to install it.
Learn more about GTK+ at http://www.gtk.org
If the package still does not load, please ensure that GTK+ is installed 
and that it is on your PATH environment variable
IN ANY CASE, RESTART R BEFORE TRYING TO LOAD THE PACKAGE AGAIN
Error : .onAttach failed in attachNamespace() for 'gWidgetsRGtk2', details:
   call: .Call(name, ..., PACKAGE = PACKAGE)
   error: C symbol name "S_gtk_icon_factory_new" not in DLL for package 
"RGtk2"

Best regards,
Janko

R version 2.13.0 (2011-04-13)
Platform: i386-pc-mingw32/i386 (32-bit)

locale:
[1] LC_COLLATE=German_Germany.1252  LC_CTYPE=German_Germany.1252
[3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C
[5] LC_TIME=German_Germany.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] gWidgets_0.0-44

loaded via a namespace (and not attached):
[1] gWidgetsRGtk2_0.0-74 RGtk2_2.20.12        tools_2.13.0
 >
#
On Fri, Jun 10, 2011 at 6:04 AM, Janko Thyson
<janko.thyson.rstuff at googlemail.com> wrote:
1. Use the automatically installed GTk2, not some other version.

2. Note that the automatically installed one will be at
...\GTk2-runtime\bin and that will be put at the *end* of your PATH.
Change it so that its at the beginning of your PATH to be sure its not
picking up something else.

3. If you are changing the path through the control panel and starting
R from the command line note that your new path won't be picked up in
old command line sessions so start a new command line session to start
R.

4. When you start a new R session double check that the automatically
installed ...\GTk2-runtime\bin is at the beginning of your path:

         strsplit(Sys.getenv("PATH"), ";")[[1]]
#
On Fri, 10 Jun 2011, Janko Thyson wrote:

            
Your subject line indicates your confusion.  It does not say RGtk2.dll 
cannot be found (at least, the English version of the message does not 
say so).

What it means is that RGtk2.dll or one of the DLLs it depends on 
cannot be found.  See the instructions at
http://cran.r-project.org/bin/windows/contrib/2.13/@ReadMe

It is Microsoft's error message, not ours.

  
    
#
It is a Microsoft error message, so your Windows is translating it, 
not R.  It does say 'The specified module' in English Windows, without 
saying who specified the module (but it does often produce a popup 
naming the module).

I've no better idea what your problem is: the @ReadMe instructions 
work for me, Uwe on winbuilder and in our teaching lab (and the advice 
in RGtk2 does not).
On Fri, 10 Jun 2011, Janko Thyson wrote:

            

  
    
#
On Fri, Jun 10, 2011 at 8:31 AM, Janko Thyson
<janko.thyson.rstuff at googlemail.com> wrote:
#1 is referring to the fact that when you run RGTk2 it will ask you if
you want it to install GTk2.  Say yes and let it install that version
to be sure you are using the right one.  If you install it yourself
manually instead you could very easily install the wrong version.

The only problem with the automatic installation is that it puts the
GTk2 dll's at the end of your PATH so you can't be sure that something
else on your path (such as graphviz which has its own potentially
conflicting dll's) won't interfere.  To fix that change the PATH so
that GTk2 is at the beginning (or at least before anything else that
could interere).

  
    
#
On 10.06.2011 14:40, Gabor Grothendieck wrote:
Hm, I did install GTK2 via the automatic installation now (choosing to 
put the DLLs in the /bin directory). The problem is, that R keeps asking 
me to repeat this step (the dialog box) every time I try to load (in new 
R sessions) either RGTk2 or gWidgetsRGtk2 displaying the same error:

Loading required package: gWidgetsRGtk2
Loading required package: gWidgets
Error in inDL(x, as.logical(local), as.logical(now), ...) :
   unable to load shared object 
'R:/Apps/R/R-2.13.0/library/RGtk2/libs/i386/RGtk2.dll':
   LoadLibrary failure:  The specified module could not be found.

Failed to load RGtk2 dynamic library, attempting to install it.
Learn more about GTK+ at http://www.gtk.org
If the package still does not load, please ensure that GTK+ is installed 
and that it is on your PATH environment variable
IN ANY CASE, RESTART R BEFORE TRYING TO LOAD THE PACKAGE AGAIN
Error : .onAttach failed in attachNamespace() for 'gWidgetsRGtk2', details:
   call: .Call(name, ..., PACKAGE = PACKAGE)
   error: C symbol name "S_gtk_icon_factory_new" not in DLL for package 
"RGtk2"

I also tried it on a different machine running Windows 7 and R-2.13.0.

:-/

Do you have any other idea?
Thanks a lot,
Janko
#
Okay, at least some positive result today (language issue ;-))

Thanks for trying. Seems like GTK2 and me are not meant to be ...

Regards,
Janko
On 10.06.2011 14:36, Prof Brian Ripley wrote:
1 day later
1 day later