Thanks Brian, It works! My problem was that I was running the program (via bash) from the emacs compile command.
I wonder why the path is not set up correctly when I use emacs to create a subprocess? The path is setup correctly when I click on the Cygwin prompt. I think emacs specifies bash.exe -- perhaps that is the problem. Do I have to specify cygwin.bat? Below is the contents of Cygwin.bat. It does not look like it sets up any environment variables to me. Why is Cygwin.bat important? I'd also like to make this compile with msvc using the MSVC version of the gd library I downloaded from boutell.com. I guess I'll send email to him as the web site suggests unless someone can suggests a forum to post in. Siegfried Cygwin.bat: @echo off C: chdir C:\cygwin\bin bash --login -i -- 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/