Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

gimp, win32, system(), libgdk.dll not found

by Arbogast (Monk)
on Jun 07, 2003 at 06:16 UTC ( [id://263925]=perlquestion: print w/replies, xml ) Need Help??

Arbogast has asked for the wisdom of the Perl Monks concerning the following question:

My apologies in advance for a mundane question, I am a gardener by trade, not a programmer. I have a simple Family Photo Album in Perl. It is happy, happy in Linux, but Windows XP is a mystery to me except as a Video Game platform. My relatives all use Windows.

It uses the GIMP at times, through a simple TK button using a system call.

Anyways, I installed GNUWin GIMP on a Windows XP personal.
I do this
my $command = 'c:\Program Files\GIMP\bin\gimp.exe';
system ($command);

I get
gimp.exe unable to locate component This application failed to start because libgdk.dll was not found. Reinstalling the application may fix this problem.

Reinstalling gimp does not help. This is so easy, a high school dropout can figure it out in Linux, what do I do in Windows???

Gimp works fine if you click on Windows Icon

2003-06-07 edit ybiC: retitle from "Help a Gardener"

Replies are listed 'Best First'.
Re: gimp, win32, system(), libgdk.dll not found
by BrowserUk (Patriarch) on Jun 07, 2003 at 07:44 UTC

    Up front I'll warn you I don't use gimp, but the symptoms you describe suggest that the Windows icon is set up to switch to the directory where gimp.exe is located before running the program and it finds the 'missing' .dll because it is then in the 'current directory'.

    A possible fix is to arrange for your program to switch to that directory before attempting to start the program. One way of doing this is to combine the commands required into one something like this.

    system 'c: & cd \Program Files\GIMP\bin & gimp.exe';

    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller


Re: gimp, win32, system(), libgdk.dll not found
by daeve (Deacon) on Jun 07, 2003 at 16:17 UTC
    First off the <disclaimer>... I don't used XP. I've installed WinGIMP on 98 and ME without problems on several machines however and from what I've seen of XP, though more like NT than 98, the GIMP and GTK installers should work (But we are talking Windo$e here so then again they may not). </disclaimer>

    Did you first install gtk+-1.3.0-XXXXXXXX-setup.zip? (where XXXXXXXX is the build date like: 20030216)
    These are the GTK+ run-time libraries. You have to install these libraries first to be able to use The Gimp. If not you will need to uninstall The GIMP, install GTK and then reinstall The GIMP.

    You can download the current GTK and GIMP for Windo$e from Jernej Simoncic's homepage at http://www2.arnes.si/~sopjsimo/gimp/.

    HTH
    Daeve

      It is greatly appreciated.
      The first solution didnt work. I am gonna try it on a different Windows machine tomorrow, to see if it is the machine or the code.
      Second reply, I installed GTK, and the Gimp works fine from the start menu. Just not from command line.
      PS
      by Arbogast (Monk) on Jun 07, 2003 at 16:39 UTC
        It is demoralizing trying to port this thing from Linux to Windows.
        Like I said, I am not a programmer, but I was able to write a nice little family photo program with music and photoediting in Perl, just off OReilly Books, Google and the Man command in Linux. If you read, all the answers are somewhere.
        I dont want to bother people with questions, is there a decent book or two that explain how to do stuff in Windows, sort of like Oreilly System Admin and Unix Power Tools books.
        Re: PS
        by daeve (Deacon) on Jun 07, 2003 at 17:49 UTC
Re: gimp, win32, system(), libgdk.dll not found
by Anonymous Monk on Jun 08, 2003 at 08:45 UTC
    From a Full time Windows SysAdmin and a Perl Hacker (Mostly on unix): First, make sure you have libgdk.dll somewhere on your system. Use the windows search functionallity to search for it. If you don't have it, your missing part of GIMP to make it work on windows. If you do, its not in the search path. You can either copy it to c:\winnt (or whatever your windows directory is, or c:\winnt\system32\) or copy it to the same directory as the EXE. Also, you may want to right click on the gimp icon you use to run GIMP, click properties. That way you can see what command it is actually running, and also from which directory it starts from.... -Tripp
      Thank you Anonymous Monk!!! What I ended up doing was this... I copied and pasted some .dll files it couldnt find from GTK to GIMP directories. Then I ran this and it behaves like a system call in Linux...

      use Win32::Process;
      use Win32;
      my $ProcessObj;
      Win32::Process::Create($ProcessObj,
      "c:\\Program Files\\GIMP\\bin\\gimp.exe",
      "start gimp.exe E:\\Sams_Data\\brian_judy.ppm",
      0,
      NORMAL_PRIORITY_CLASS, ".")|| die ErrorReport();
      $ProcessObj->Wait(INFINITE);

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://263925]
Approved by jonnyfolk
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2024-03-28 12:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found