This is the mail archive of the
mailing list for the Cygwin project.
Re: cygwin1.dll incluson in Cygwin makefile
- From: Brian Dessent <brian at dessent dot net>
- To: Paul Newell <pnewell at cs dot cmu dot edu>
- Cc: cygwin at cygwin dot com
- Date: Mon, 26 May 2008 02:41:51 -0700
- Subject: Re: cygwin1.dll incluson in Cygwin makefile
- References: <483A64DE.email@example.com>
- Reply-to: cygwin at cygwin dot com
Paul Newell wrote:
> Quite simply, I installed the current cygwin today, it did a wonder job
> of running make on a c/c++ file and produce an *.exe. However, if I open
> up a window to the directory and try to double click it, I get the "no
> cygwin1.dll". If I try to run the program within cygwin's world, it
> doesn't know anything more about the universe as it seems to only
> understand its local space within "home". I tried to figure out how to
> link in cygwin1.dll, but the compile says it can't find it even if I
> give absolute path within the cygwin world.
If you build a program with Cygwin's gcc, it is a Cygwin program,
meaning it is linked with cygwin1.dll and is dependant on that library
for POSIX emulation. The library must be in the PATH or in the same
directory as the .exe, the same as with any library. There is nothing
magical about the "cygwin world", simply the fact that /usr/bin (i.e.
the location of cygwin1.dll) is added to PATH in the startup files that
the shell executes. There's no reason that you can't do that yourself.
There is no way for a Cygwin program to not depend on cygwin1.dll; it
cannot be statically linked. This is explained in the FAQ.
> Maybe I am trying to do something I shouldn't be doing. The program is
> designed to scan the entire drive an give an html of the contents. So I
> need to build an executable within Cgywin that I can run globally within
> Windows universe.
You can distribute the Cygwin library with your program, or you can use
something else use such as MinGW. You can't get POSIX compatibility
without also depending on the Cygwin library, however. And also
remember that if you choose to distribute your code as a Cygwin app then
you must obey the Cygwin licensing rules.
> Any advice / education is appreciated. Sorry if this is longer email
> than it should be, but I'm a newbie and I have no idea where is email is
> going (though I will probably find out soon enough)
It's called a mailing list, read <http://cygwin.com/cygwin/lists.html>.
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html