From: Keith M. <kei...@us...> - 2009-05-20 19:37:31
|
On Tuesday 19 May 2009 10:14:12 notmmao wrote: >> I copied libfl.a into the same directory where the program >> lex.yy.c is >> >> located. > > d:\workspace\htiny\scand\lexscan>gcc lex.yy.c libfl.a Yep, that would work, (provided the command is run with the directory in which both lex.yy.c and libfl.a are to be found, set as `current directory'). However... > or > d:\workspace\htiny\scand\lexscan>gcc lex.yy.c -I./ -llibfl ...this will *not* work; (`-I' is for headers, *not* libraries, and `-llibfl' refers to liblibfl.a, *not* to libfl.a). The correct form of the latter command is:-- gcc lex.yy.c -L. -lfl (`-L.' adds current directory to the library search path, and `-lfl' refers to libfl.a, in the first directory where it can be found, in that path, (which will be the current directory in this case)). -- Regards, Keith. |