This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Cygwin + Windows 7 + (C++) + GNU Science Library (GSL) Not Working

Hi Dilan,

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++ ? ? ? -o 8DMonteCarloIntegration
> /cygdrive/c/Users/DEFAUL~1.DIL/AppData/Local/Temp/
> 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
Unix-like platform.
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:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]