X-Spam-Check-By: sourceware.org
To: cygwin@cygwin.com
From: Lewis Hyatt <lhyatt@princeton.edu>
Subject:  Re: Help with strange compiler error linking to GSL
Date:  Thu, 05 Jul 2007 16:31:25 -0400
Lines: 35
Message-ID: <f6jkeu$1qi$1@sea.gmane.org>
References:  <002f01c7bf41$22b44f10$0701a8c0@lee8075b>
Mime-Version:  1.0
Content-Type:  text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding:  7bit
User-Agent: Thunderbird 1.5.0.12 (Windows/20070509)
In-Reply-To: <002f01c7bf41$22b44f10$0701a8c0@lee8075b>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Lee Rhodes wrote:
> Brian,
>    Thanks.  Here is the output from Eclipse:
> 
> 
> make -k all 
> Building file: ../main.cpp
> Invoking: GCC C++ Compiler
> g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.d"
> -o"main.o" "../main.cpp"
> Finished building: ../main.cpp
>  
> Building target: TestGSL.exe
> Invoking: GCC C++ Linker
> g++  -o"TestGSL.exe"  ./main.o   
> ./main.o: In function `main':
> /cygdrive/f/CPP/TestGSL/Debug/../main.cpp:7: undefined reference to
> `_gsl_sf_bessel_J0'
> collect2: ld returned 1 exit status
> make: *** [TestGSL.exe] Error 1
> make: Target `all' not remade because of errors.
> Build complete for project TestGSL
> 
> Lee.
>    
> 
> 

I don't know anything about Eclipse, but clearly you are not telling it 
to link to the gsl library anywhere, since the command it is running 
doesn't include -lgsl. You need to find the equivalent of the "LDFLAGS" 
Makefile variable.

-Lewis



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

