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

Janko Thyson janko.thyson.rstuff at googlemail.com
Fri Jun 10 15:05:45 CEST 2011

On 10.06.2011 14:40, Gabor Grothendieck wrote:
> On Fri, Jun 10, 2011 at 8:31 AM, Janko Thyson
> <janko.thyson.rstuff at googlemail.com>  wrote:
>> On 10.06.2011 13:00, Gabor Grothendieck wrote:
>> On Fri, Jun 10, 2011 at 6:04 AM, Janko Thyson
>> <janko.thyson.rstuff at googlemail.com>  wrote:
>> 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.
>> 1. Use the automatically installed GTk2, not some other version.
>> Thanks for answering. I didn't even know there GTk2 already ships with R.
>> Prof. Brian Ripley linked me to the readme file with recommendations with
>> respect to an GTK2 distribution to use:
>> "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 "
>> 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.
>> My R distribution does not seem to have such a directory (standard windows
>> R-2.13.0 installer from CRAN)
>> How do I manage to have this ...\GTk2-runtime\bin directory available?
> #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).
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 
   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
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 

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,

>> Thanks a lot,
>> Janko
>> 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]]
>> --
>> ________________________________
>> Janko Thyson
>> janko.thyson at googlemail.com
>> Jesuitenstraße 3
>> D-85049 Ingolstadt
>> Mobile: +49 (0)176 83294257
>> This e-mail and any attachment is for authorized use by the intended
>> recipient(s) only. It may contain proprietary material, confidential
>> information and/or be subject to legal privilege. It should not be
>> copied, disclosed to, retained or used by any other party.
>> If you are not an intended recipient then please promptly delete this
>> e-mail and any attachment and all copies and inform the sender.

More information about the R-devel mailing list