[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
link error about flex++ using with g++
From: |
jinjun guo |
Subject: |
link error about flex++ using with g++ |
Date: |
Tue, 19 Oct 2004 13:32:58 -0700 (PDT) |
I have a simple lex file "foo.l":
//-----------begin---------------------
%{
#include <iostream>
using namespace std;
%}
string [a-zA-Z]+
%%
{string} { cout << "A string is found!\n"; }
//-------------end---------------------------
When I execute the following commands:
%> flex++ foo.l
%> g++ lex.yy.cc -lfl
It always reports:
/usr/lib/libfl.a(libmain.o): In function `main':
libmain.o(.text+0x11): undefined reference to `yylex'
collect2: ld returned 1 exit status
----------My question-------------------------
What is wrong with my code?
------------------------------------------------
// some information
flex++ version 2.5.4
g++ version 3.2.3
Thanks a lot.
JJ
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- link error about flex++ using with g++,
jinjun guo <=