This is the mail archive of the
mailing list for the Cygwin project.
RE: why is -L/usr/local/lib necessary?
- From: "Dave Korn" <dave dot korn at artimi dot com>
- To: <cygwin at cygwin dot com>
- Date: Tue, 14 Dec 2004 17:27:37 -0000
- Subject: RE: why is -L/usr/local/lib necessary?
> -----Original Message-----
> From: cygwin-owner On Behalf Of Sam Steingold
> Sent: 14 December 2004 17:02
> Subject: why is -L/usr/local/lib necessary?
> why doesn't "gcc -lfoo" (ld) find /usr/local/lib/foo.dll?
1) It won't look in /usr/local/lib by default. "gcc -print-search-dirs" should
clarify this for you, or "gcc -v -lfoo", which shows you the exact command line
used to invoke ld.
2) You can't statically link against a .dll anyway. You statically link (at
compile time) against .a files; you dynamically link (at runtime) against .dll
> what do I do to avoid this?
Don't write a program that needs to link against libfoo?
Look, you have only two choices. Either put your libs in the default search
path, or specify the path. It's not unreasonable that gcc can't magically guess
where you've hidden them.
Can't think of a witty .sigline today....
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html