Compiling for dummies ;)

Discussion in 'Green Room' started by Glaanieboy, Sep 2, 2003.

  1. Glaanieboy

    Glaanieboy Moderator

    Messages:
    2,626
    Location:
    The Netherlands
    I installed PHP on my system with the purpose to test php stuff locally. Among the php files was a script that (apparently) needed the gd-library. I downloaded the gd-library from Boutell.com and it had to be compiled (I downloaded the Windows version btw, because I am using this under Windows), so I searched for a C-compiler. According to the manual provided with gd, mingw32 is a good choice. BUT, what next? I tried 'gcc gd.c', but all it gives are errors (see attached file) about missing files. Please guide me through this yet unexplored part of programming (I only did a bit with turbo pascal, but that are simple programs).
     
  2. Glaanieboy

    Glaanieboy Moderator

    Messages:
    2,626
    Location:
    The Netherlands
    I forgot to attach the file
     
  3. Jason2k1

    Jason2k1 Guest

    I believe recent versions of php already have the gd libary included.

    Quote from http://uk2.php.net/function.imagecreatefromjpeg:
    ------------------------
    Want to make this work under Windows and wonder how to compile the gd lib into an already existing binary?
    You don't have to. Just do it like this:

    Download the Windows ZIP package from http://www.php.net/downloads.php
    (You MUST use the ZIP package because the installer version does not contain any extensions. If you already installed using the installer version than thats just fine - download the ZIP nevertheless and continue below.)

    Unzip the package to a temporary directory and copy the file extension\php_gd2.dll from there to your PHP folder (C:\PHP).

    Open PHP.INI in your Windows directory, find this line:
    ;;;;;;;;;;;;;;;;;;;;;;
    ; Dynamic Extensions ;
    ;;;;;;;;;;;;;;;;;;;;;;

    Below that find this line:
    ;extension=php_gd2.dll
    ... and uncomment it by removing the ;

    That's it! Isn't it fun to be a Windowsy while others have to compile?! ;)

    ------------------------

    Hope this helps
     
  4. X-Istence

    X-Istence * Political User

    Messages:
    6,498
    Location:
    USA
    I love compiling, its so wonderfull watching 50,000 lines flash in front of your eyes.
     
  5. Glaanieboy

    Glaanieboy Moderator

    Messages:
    2,626
    Location:
    The Netherlands
    Well, at first it didn't work. (I had phpTriad installed, MySQL, Apache and PHP in one package). I ended up making such a mess, I installed everything, one by one. First Apache, then PHP (MySQL is not needed at this time). I made a backup of the last httpd.conf file used by Apache and crosschecked it with the new file for references to PHP. I copied all of the stuff I could find about PHP in the old file to the new file (in the appropiate places of course) and tada it worked. I hate text-files <_< >.<
     
  6. Glaanieboy

    Glaanieboy Moderator

    Messages:
    2,626
    Location:
    The Netherlands
    I find it rather cool too, BUT IT MUST WORK!
     
  7. X-Istence

    X-Istence * Political User

    Messages:
    6,498
    Location:
    USA
    WEll, dont compile for windows then =).
     
  8. Glaanieboy

    Glaanieboy Moderator

    Messages:
    2,626
    Location:
    The Netherlands
    I didn't have a choice. I only installed this sh!t on Windows so I could use my Winamp (song) script again. With the only difference I added a FTP-upload section to it so that it will upload to my personal webspace at my ISP.
    This is all for the time being, so long Geffy's server is 'offline'.
     
  9. X-Istence

    X-Istence * Political User

    Messages:
    6,498
    Location:
    USA
    Ah, is that the reason.