473,394 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

compilation error of Lex.yy.c

Hi,
I just have the simple lex program
%%
. ECHO;
%%
int main()
{
yylex();
}

i did this, lex sample.l, which resulted in lex.yy.c then i tried to
complie the produced c file, on which i get the following error,

/tmp/ccYMo5KN.o: In function `yylex':
/tmp/ccYMo5KN.o(.text+0x353): undefined reference to `yywrap'
/tmp/ccYMo5KN.o: In function `input':
/tmp/ccYMo5KN.o(.text+0xb1a): undefined reference to `yywrap'
collect2: ld returned 1 exit status

Only way i have worked out is to have my own yywrap() function which
returns 1 always, but having said iam not able to understand the cause
of the problem, a simple lex program should work, like the following
%%
.. ECHO;
%%

but why isn't?

Mar 27 '06 #1
2 13550
sa*****@yahoo.co.in wrote:
Hi,
I just have the simple lex program
%%
. ECHO;
%%
int main()
{
yylex();
}

i did this, lex sample.l, which resulted in lex.yy.c then i tried to
complie the produced c file, on which i get the following error,

/tmp/ccYMo5KN.o: In function `yylex':
/tmp/ccYMo5KN.o(.text+0x353): undefined reference to `yywrap'
/tmp/ccYMo5KN.o: In function `input':
/tmp/ccYMo5KN.o(.text+0xb1a): undefined reference to `yywrap'
collect2: ld returned 1 exit status

Only way i have worked out is to have my own yywrap() function which
returns 1 always, but having said iam not able to understand the cause
of the problem, a simple lex program should work, like the following
%%
. ECHO;
%%

but why isn't?


This is not a good place to ask this question, as it deals only with
standard C. Ask either in comp.compilers or a group specific to your
tools, which you've not specified.

Mar 27 '06 #2

<sa*****@yahoo.co.in> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
Hi,
I just have the simple lex program
%%
. ECHO;
%%
int main()
{
yylex();
}

i did this, lex sample.l, which resulted in lex.yy.c then i tried to
complie the produced c file, on which i get the following error,

/tmp/ccYMo5KN.o: In function `yylex':
/tmp/ccYMo5KN.o(.text+0x353): undefined reference to `yywrap'
/tmp/ccYMo5KN.o: In function `input':
/tmp/ccYMo5KN.o(.text+0xb1a): undefined reference to `yywrap'
collect2: ld returned 1 exit status

Only way i have worked out is to have my own yywrap() function which
returns 1 always, but having said iam not able to understand the cause
of the problem, a simple lex program should work, like the following
%%
. ECHO;
%%

but why isn't?


You're missing an '%option noyywrap'. You usually need a yywrap() function.
So, I'd recommend adding one for now:

int yywrap()
{
return(1);
}

http://www.gnu.org/software/flex/man...mono/flex.html

Mar 27 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: konf | last post by:
Hallo, I tried to compile PGSQL 7.4 and I got error (durring make): ar: command not found What is it? Whe I can found it? I have: $ uname -a SunOS ... 5.8 Generic_108528-03 sun4u sparc...
10
by: Sune | last post by:
Hi, previously I used Eclipse CDT for compiling my files just to get started with C and leave C++ behind. Now it's time to get a little more serious so I've moved my files to a new workplace and...
6
by: Joachim | last post by:
I made some project changes (which seems it doesn't help if I undo) which have created compilation error: " Server Error in '/PCSWebApp1' Application....
2
by: James Zhuo | last post by:
Hi all I've been getting the following compilation error. I should explain the background of the project that i am taking over. This is a project that has been developed by someone else a while...
0
by: James Zhuo | last post by:
hi all I changed the name of the class LoginPage to a different name "LoginPageOne" But the same error gets generated with the Wiliam.Request.LoginPageOne. That pretty much leaves me clueless...
3
by: Dan | last post by:
Hi, I have a problem using an aspx page with a Control on it. I get the following error message Compiler Error Message: CS1595: 'Test.Class2' is defined in multiple places; using definition...
6
by: Plat | last post by:
I've Googled this for a while, to no avail. Hopefully someone can help me. Maybe I'm using the wrong terminology. Here's the scoop! Let's say I've got a simple *.ASPX page that has a syntax...
3
by: Robert | last post by:
I have a number of web projects converted from 1.1 to 2.0 in VS2005. I am methodically seeing the error below: The element 'compilation' has invalid child element 'compilers'. List of...
0
by: Stimp | last post by:
I've created an aspx page called HistoryManage.aspx. The page works fine on my local machine but when I load it off the web I get the following strange error... Compilation Error...
1
by: BSand0764 | last post by:
I'm getting an error that I can't seem to resolve. When I compile the Functor related logic in a test program, the files compile and execute properly (see Listing #1). However, when I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.