How to write minimal program using GD library

Brian Dessent brian@dessent.net
Sun Jun 19 12:11:00 GMT 2005


Siegfried Heintze wrote:

> 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?

When you run cygwin.bat, that starts a login shell.  When you start bash
from emacs, that is just a regular shell, not a login shell.  The
difference matters as to which files bash reads (e.g. /etc/profile,
~/.bashrc, ~/.profile, etc.)  Read "man bash" section INVOCATION.  If
some aspect of the PATH is only set in the profile then it will only
occur for login shells.  Though normally once an environment variable is
set, it is inherited in subshells, so I don't know why your PATH is not
inherited correctly.  The default set of startup scripts that comes with
Cygwin should be correct in terms of having a correct PATH set for you,
even in subshells, but it's possible you stumbled upon a situation where
something needs to be fixed.

You will have to investigate the contents of your startup files and the
manner in which emacs invokes the shell in order to find out why.  It
could also have to do with the fact that emacs probably launches /bin/sh
by default (not bash), which has its own rules for which startup files
to read (e.g. sh does not know about ~/.bashrc.)  I can't really tell
you more off-hand because a) I have long since modified most of my
startup files and b) I don't use emacs.  You'll have to trace it through
to find out what's going on.  You might add a "set +x" to the top of all
such files to make them print out the commands as they're being
executed.

> 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.

I don't know anything about that, sorry.  It's off-topic for this list.

Brian

--
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/



More information about the Cygwin mailing list