delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/02/22/11:11:02

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-0.7 required=5.0 tests=AWL,BAYES_50,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,T_TO_NO_BRKTS_FREEMAIL
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <30986807.post@talk.nabble.com>
References: <30986807 DOT post AT talk DOT nabble DOT com>
Date: Tue, 22 Feb 2011 17:10:35 +0100
Message-ID: <AANLkTikgHJ_RNije7xi3V7=_96AEOTFmJUKzGauQFfj1@mail.gmail.com>
Subject: 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>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Hi Dilan,

On Tue, Feb 22, 2011 at 4:36 PM, Dilan Shah wrote:
(snip)
> Whenever I try to compile this code in Cygwin it gives the following erro=
r:
>
> $ make 8DMonteCarloIntegration
> g++ =A0 =A0 8DMonteCarloIntegration.cc =A0 -o 8DMonteCarloIntegration
> /cygdrive/c/Users/DEFAUL~1.DIL/AppData/Local/Temp/ccNuQcib.o:8DMonteCarlo=
Integration.cc:(.text+0x99):
> 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
names).


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,
Csaba
--=20
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 Torv=
alds
"People disagree with me. I just ignore them." -- Linus Torvalds

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019