Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com From: "Siegfried Heintze" To: Subject: How to write minimal program using GD library Date: Fri, 17 Jun 2005 23:11:11 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit In-Reply-To: <415E1C6E.6BB536B5@dessent.net> Message-ID: <8033322.1119071608859.JavaMail.SYSTEM@CCC-NOVA1> X-IsSubscribed: yes I'm looking at the GD documentation (a C graphics library) and it pointed me to a simple minimal C program. I cut and pasted this. See below. I cannot get it to work, however, with g++ or msvc v7. When I follow the directions with gcc, it compiles and links fine but when I try to run the resulting program, I get the following error: This application has failed to start because cygXpm-4.dll was not found. Re-installing the application may fix this problem. I've downloaded nearly the entirety of Cygwin and I cannot find such a dll. How do I make this minimal program work? When linking with C libraries downloaded as part of Cygwin, do I have to do anything special? The documentation says no. I would guess that gcc automatically knows to look in C:\cygwin\lib -- is this correct? Thanks Siegfried /*** * Begin commands to execute this file using g++ with bash * gcc gddemo.c -o gddemo.exe -lgd * cygpath gddemo.exe * ./gddemo.exe < int main() { /* Declare the image */ gdImagePtr im; /* Declare output files */ FILE *pngout, *jpegout; /* Declare color indexes */ int black; int white; /* Allocate the image: 64 pixels across by 64 pixels tall */ im = gdImageCreate(64, 64); /* Allocate the color black (red, green and blue all minimum). Since this is the first color in a new image, it will be the background color. */ black = gdImageColorAllocate(im, 0, 0, 0); /* Allocate the color white (red, green and blue all maximum). */ white = gdImageColorAllocate(im, 255, 255, 255); /* Draw a line from the upper left to the lower right, using white color index. */ gdImageLine(im, 0, 0, 63, 63, white); printf("call gdImageLine\n"); /* Open a file for writing. "wb" means "write binary", important under MSDOS, harmless under Unix. */ pngout = fopen("test.png", "wb"); printf("call fopen\n"); /* Do the same for a JPEG-format file. */ jpegout = fopen("test.jpg", "wb"); printf("call gdImgPng\n"); /* Output the image to the disk file in PNG format. */ gdImagePng(im, pngout); /* Output the same image in JPEG format, using the default JPEG quality setting. */ gdImageJpeg(im, jpegout, -1); /* Close the files. */ fclose(pngout); fclose(jpegout); /* Destroy the image in memory. */ gdImageDestroy(im); } -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/