[SLUG] Libraries/Programming Question

From: Paul M Foster (paulf@quillandmouse.com)
Date: Sun Sep 07 2003 - 03:05:06 EDT


Coders:

See the following output from a compile of a program called "stats":

gcc -L /usr/local/lib -o stats stats.o -lfl -ldate -lstrutil -lpcfg
/usr/local/lib/libpcfg.a(pcfglex.o)(.text+0x757): In function `yylex':
/home/paulf/src/pcfg/pcfglex.c:873: undefined reference to `yywrap'
/usr/local/lib/libpcfg.a(pcfglex.o)(.text+0x1094): In function `input':
/home/paulf/src/pcfg/pcfglex.c:1201: undefined reference to `yywrap'
collect2: ld returned 1 exit status
make: *** [stats] Error 1

Note the libraries being linked in above. The pcfg _project_ contains a
program called pcfgtest that tests the pcfg code. It uses flex, and the
pcfgtest executable links with the flex library (-lfl). The pcfgtest
program compiles, links and runs correctly. I built libdate, libstrutil
and libpcfg for use with various projects, including this stats project.
The stats.c file has an #include "pcfg.h" instruction.

What I don't understand is that the linker errors I'm getting don't
occur with pcfgtest, but only with the stats executable. And the stats
executable doesn't actually need flex, except by way of pcfg.

Anyone have a clue what I should do to fix this?

Paul

-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS). Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 20:20:39 EDT