This is the mail archive of the
mailing list for the Cygwin project.
Re: Cygwin + Windows 7 + (C++) + GNU Science Library (GSL) Not Working
- From: Csaba Raduly <rcsaba at gmail dot com>
- To: cygwin at cygwin dot com
- Cc: Dilan Shah <mario_fan at hotmail dot com>
- Date: Tue, 22 Feb 2011 17:10:35 +0100
- Subject: Re: Cygwin + Windows 7 + (C++) + GNU Science Library (GSL) Not Working
- References: <firstname.lastname@example.org>
On Tue, Feb 22, 2011 at 4:36 PM, Dilan Shah wrote:
> Whenever I try to compile this code in Cygwin it gives the following error:
> $ make 8DMonteCarloIntegration
> g++ ? ? 8DMonteCarloIntegration.cc ? -o 8DMonteCarloIntegration
> undefined reference to `_gsl_rng_default'
Your makefile is wrong. You told make to build the file
8DMonteCarloIntegration, but you haven't told make how to do it: there
is no target called 8DMonteCarloIntegration. Make did its best with a
built-in rule it has, but you didn't set up the make variables for
that to work correctly.
In general, you shouldn't put compiler options into the variable that
defines the compiler. There are separate variables for that, e.g.
CFLAGS for the C compiler, CXXFLAGS for the C++ compiler, CPPFLAGS for
the preprocessor (you should put -I and -D flags here), LDFLAGS for
the linker (e.g. -L for library location but not -l for library
This is not a Cygwin problem. You would get the same error on any
You should read the documentation for GNU make (especially sections
10.2 Catalog of implicit rules and 10.3 Variables used by implicit
rules) and/or ask on a general programming forum.
Hope this helps,
GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++
Life is complex, with real and imaginary parts.
"Ok, it boots. Which means it must be bug-free and perfect. " -- Linus Torvalds
"People disagree with me. I just ignore them." -- Linus Torvalds
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple