delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/08/19/12:22:52

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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
Message-ID: <4306071D.4010201@familiehaase.de>
Date: Fri, 19 Aug 2005 18:21:49 +0200
From: "Gerrit P. Haase" <gerrit AT familiehaase DOT de>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.11) Gecko/20050728
MIME-Version: 1.0
To: Herb Martin <HerbM AT learnquick DOT com>
CC: cygwin AT cygwin DOT com
Subject: Re: Trying to build crm114 (20050721) under CygWin 1.5.18-1
References: <EILH7OR-0006DK-50 AT mail2 DOT learnquick DOT com>
In-Reply-To: <EILH7OR-0006DK-50@mail2.learnquick.com>
X-IsSubscribed: yes

Herb Martin wrote:

>>>cannot find -ltre
>>>collect2: ld returned 1 exit status
>>>make[1]: *** [crm114_tre] Error 1


> LDFLAGS += -L/usr/local/lib  
> LIBS += -ltre -lintl -liconv 
>   	(and trying -ltre at the end; is THIS the order
> 	you were referencing?)
> 
> The dependency tha that is failing looks like this:
> 
> crm114_tre: $(OFILES) crmregex_tre.o
> 	#   Note: if you haven't installed TRElib, the next step 
> 	#   will get an error.
> 	#       For TRElib, look in the TRE sub-directory of this kit.
> 	#   Remember to use ./configure --enable-static for static libs.
> 	#   You will also need to add /usr/local/lib to /etc/ld.so.conf,
> 	#   and then run ldconfig (as root) to set the library up and make
> 	#   the library known to the static and runtime linkers.
> 	$(CC) $(LDFLAGS) $(LIBS) $(OFILES) \
> 	  crmregex_tre.o \
> 	  -lm -ltre -o crm114_tre

This is wrong. Try this instead:

  	$(CC) $(LDFLAGS) $(OFILES) \
  	  crmregex_tre.o \
  	  -ltre $(LIBS) -o crm114_tre



> My tre libs looks like this:
> 
> $ d /usr/local/lib/*tre*
> rw-r--r--  herbm:None  349K  Aug 18 21:29  libtre.a
> rwxr-xr-x  herbm:None   789  Aug 18 21:29  libtre.la

Then you should go with the settings as you posted above:

LDFLAGS += -L/usr/local/lib
LIBS += -lintl -liconv


> $ d ./tre-0.7.2/lib
> rw-r--r--  herbm:None   18K  Aug 18 19:34  Makefile
> rwxr-xr-x  herbm:None   707  Dec 10  2004  Makefile.am
> rwxr-xr-x  herbm:None   19K  Dec 11  2004  Makefile.in
> rwxr-xr-x  herbm:None    3K  Apr 24  2004  gettext.h
> rw-r--r--  herbm:None   788  Aug 19 05:58  libtre.la
> rwxr-xr-x  herbm:None  2.7K  Nov 21  2004  readme


Here is no library.  Just the libtool .la helper file.


> Current error looks like this:
[snip]
> gcc -static -L./tre-0.7.2/lib -L/usr/local/lib   -ltre -lintl -liconv
> *.o \
>   -lm -ltre -o crm114_tre
> /usr/local/lib/libtre.a(regerror.o): In function `regerror':
> /etc/mail/spamassassin/crm114-20050721-BlameNeilArmstrong.src/tre-0.7.2/lib/
> regerror.c:68: undefined reference to `_libintl_gettext'
> collect2: ld returned 1 exit status
> make[1]: *** [crm114_tre] Error 1


Change the Makefile so that $LIBS are at the end behind the objects
and libtre as noted above since libtre reqwuires libintl and the
linker reads command lines from right to left.


Gerrit
-- 
=^..^=

--
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/

- Raw text -


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