Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 709463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:30:26+00:00 2026-05-14T04:30:26+00:00

When I attempt to compile the output of this trivial lex program: # lex.l

  • 0

When I attempt to compile the output of this trivial lex program:

# lex.l
integer   printf("found keyword INT");

using:

$ gcc lex.yy.c

I get:

Undefined symbols:
  "_yywrap", referenced from:
      _yylex in ccMsRtp7.o
      _input in ccMsRtp7.o
  "_main", referenced from:
      start in crt1.10.6.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

lex –version tells me I’m actually using ‘flex 2.5.35’ although ls -fla `which lex` isn’t a symlink. Any ideas why the output won’t compile?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T04:30:26+00:00Added an answer on May 14, 2026 at 4:30 am

    From the Flex manual:

    I get an error about undefined yywrap().

    You must supply a yywrap() function of your own, or link to libfl.a (which provides one), or use

    %option noyywrap
    

    in your source to say you don’t want a yywrap() function.

    Also:

    When the scanner receives an
    end-of-file indication from
    YY_INPUT, it then checks the yywrap() function. If
    yywrap() returns false (zero), then it is assumed that the
    function has gone ahead and set up yyin to point to
    another input file, and scanning continues. If it returns
    true (non-zero), then the scanner terminates, returning 0
    to its caller. Note that in either case, the start condi-
    tion remains unchanged; it does not revert to INITIAL.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I found only one attempt to create such compiler - http://sourceforge.net/projects/xsltc/ . But this
I cannot get a wxWidgets program that uses the wxWidgets static libraries to compile
This is my first attempt to compile a main.cpp file with cygwin. The command
First attempt to use this cool site - after searching for 2 hours: So
This is my first attempt at responsive design, so I'm keeping it simple. I
I'm attempting to compile a simple hello world program in c with lcc-win32/wedit, and
Okay, sample code first; this is my attempt at communicating what it is that
I'm writing a compiler to compile a subset of Java to Java bytecode using
This is my first attempt at C++, following an example to calculate a tip
This is my first attempt at creating a package, so I must be missing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.