On Fri, 19 Aug 2005, Herb Martin wrote:

> > From Behalf Of Brian Dessent
> >
> > > gcc -static -L/usr/local/lib:/lib  -lintl -liconv  crm_main.o
> > > crm_compiler.o crm_errorhandlers.o crm_exec_engine.o crm_p
> <snip a bunch of .o references>
> > >   -lm -ltre -o crm114_tre
> > >
> > /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld:
> > > cannot find -ltre
> > > collect2: ld returned 1 exit status
> > > make[1]: *** [crm114_tre] Error 1
>
> > Now you've got the order wrong.  The objects must be
> > specified in dependent order, which generally means libraries
> > after objects.
>
> Order of what specifically?  I am modifying these lines in
> the Makefile:
>
> LDFLAGS += -L/usr/local/lib
> #LIBS += -lintl -liconv
>
> I uncommented the second line and added various
> combinations of -L to the first, and -ltre to the
> second.
>
> LDFLAGS += -L/usr/local/lib
> LIBS += -ltre -lintl -liconv
>       (and trying -ltre at the end; is THIS the order
>       you were referencing?)

No...

> 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) \
                         ^^^^^^^^^^^^^^^^^
...This is.  The Makefile is buggy -- $(LIBS) should go *after* $(OFILES).

>         crmregex_tre.o \
>         -lm -ltre -o crm114_tre
> [snip]

I'm surprised the Makefile is not using the default link rule, e.g.,
something like

LDFLAGS += -L/usr/local/lib
LDLIBS += -lm -ltre
LDLIBS += -lintl -liconv
crm114_tre: $(OFILES) crmregex_tre.o
        $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@

which would do the right thing w.r.t. library order, etc...
        Igor
-- 
                                http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_                [EMAIL PROTECTED]
ZZZzz /,`.-'`'    -.  ;-;;,_            [EMAIL PROTECTED]
     |,4-  ) )-,_. ,\ (  `'-'           Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL     a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

If there's any real truth it's that the entire multidimensional infinity
of the Universe is almost certainly being run by a bunch of maniacs. /DA

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

Reply via email to