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 7751329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:31:13+00:00 2026-06-01T11:31:13+00:00

My Lex file main.l : %{ #include <stdio.h> %} %% start printf(Start command received\n);

  • 0

My Lex file main.l:

%{
    #include <stdio.h>
%}
%%
start               printf("Start command received\n");
stop                printf("Stop command received\n");
%%

Create main.c file command:

> flex -Palone -omain.c main.l

Then try to compile it:

> gcc main.c -o main -lfl

and got the following errors:

  "_alonewrap", referenced from:
      _alonelex in ccdqmJjR.o
      _input in ccdqmJjR.o
  "_yylex", referenced from:
      _main in libfl.a(libmain.o)

How to compile the lex program created with the prefix?

  • 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-06-01T11:31:14+00:00Added an answer on June 1, 2026 at 11:31 am

    If you use prefix, libfl is not for you. You must provide your own main function and your own <prefix>wrap function (or say you don’t want one with %option noyywrap, see flex manual).

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

Sidebar

Related Questions

#include<stdio.h> #include<string.h> #include<stdlib.h> int main() { // int char str[40],ch; FILE*fp,*fp1,*fp2; fp=fopen(ide_input,w); fp1=fopen(error_log,w); fp2=fopen(lex_output,w);
Does anyone know where a FLEX or LEX specification file for Python exists? For
I have an experimental flex source file(lex.l): %option noyywrap %{ int chars = 0;
I have a relatively simple lex/flex file and have been running it with flex's
I would like to call flex to build a .l file, then call gcc
I have a YACC (Bison) grammar, a Lex (Flex) tokenizer, and a C program
I insist on using lex and not the flex. am developing an API in
For the example.l lex file I get the error below. If I comment out
I'd like to use lex/yacc to read in a delimited text file. This would
I need to make a scanner in lex/flex to find tokens and a parser

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.