LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-22-2024, 05:28 AM   #16
ajiten
Member
 
Registered: Jun 2023
Posts: 377

Original Poster
Rep: Reputation: 4

Quote:
Originally Posted by ntubski View Post
Sorry, but if possible to see directly on cygwin, the details about: -lfl option for cc, which I hope is linker for flex.
I derived this (i.e., -lfl option for cc being for the linker) conclusion, as the response by @Nevem_Teve seems to point that the need for '-ll' (which I interpret as '-lfl' for flex) option for cc is obviated, if the yywrap() is specified in the lex file.

Last edited by ajiten; 01-22-2024 at 06:17 AM.
 
Old 01-22-2024, 06:19 AM   #17
ajiten
Member
 
Registered: Jun 2023
Posts: 377

Original Poster
Rep: Reputation: 4
Quote:
Originally Posted by NevemTeve View Post
Off; no private messages, please
On: kindly read my previous posts: `-ll` is to be dropped; add this line into your program;
Code:
int yywrap(void) { return 1; }
PS: basic usage of the C-compiler should have been learnt already, but nonetheless here is a quickstart document: https://www3.ntu.edu.sg/home/ehchua/.../gcc_make.html
Please tell why the -lfl option, for cc in cygwin; is not needed, when add the stated yywrap(void) function, to the program.

Seems the -lfl option is for linker. If so, what role does it serve?

----
Want to add that have come across just now, that states something similar (as shown in the attachment).

But, want to delve more into details, than by the one-liner stated there (i.e., 'The -lfl option to gcc tells the linker to link the flex runtime library into the executable.'), i.e. to see how the linker operates.

---------
2. Want to add to my last line above, that am not helped by the details offered here (also, shown in the attachment) or 'even' here, but need some practical exercises that really take to that level. Some source (book, site) would be needed, unless something is offered 'directly' by your kind side.
Attached Thumbnails
Click image for larger version

Name:	Screenshot (91).jpg
Views:	4
Size:	165.2 KB
ID:	42455  

Last edited by ajiten; 01-22-2024 at 06:54 AM.
 
Old 01-22-2024, 08:15 AM   #18
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,874
Blog Entries: 1

Rep: Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871
Option `-ll` means: 'find and use libl.a (or libl.so, whichever comes first)', option `-lfl` means 'find and use libfl.a (or libfl.so)'.

`libl.a` belongs to the original `lex`, while `libfl.a` belongs to the replacement product `flex`.

Now the common part in these two is that you need neither of them.
 
Old 01-22-2024, 11:23 PM   #19
ajiten
Member
 
Registered: Jun 2023
Posts: 377

Original Poster
Rep: Reputation: 4
Quote:
Originally Posted by NevemTeve View Post
Option `-ll` means: 'find and use libl.a (or libl.so, whichever comes first)', option `-lfl` means 'find and use libfl.a (or libfl.so)'.

`libl.a` belongs to the original `lex`, while `libfl.a` belongs to the replacement product `flex`.

Now the common part in these two is that you need neither of them.
Please tell if the lack of need of either of them, is due to including the yywrap() (and possibly other functions, though unneeded here). If yes, then please refer to some sources.

----

Also, request how to get help on cc (gcc) options as '-lfl' on cygwin terminal, as the below attachment shows that couldn't get it.
Attached Thumbnails
Click image for larger version

Name:	Screenshot (92).png
Views:	14
Size:	184.9 KB
ID:	42456  

Last edited by ajiten; 01-22-2024 at 11:28 PM.
 
Old 01-23-2024, 01:03 AM   #20
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,874
Blog Entries: 1

Rep: Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871
You have been given many documentation about gcc and ld, kindly read them. Also you can use command `man gcc`

`yywrap` is one of the functions you have to implement to get your lexical parser work. Resolving `yywrap` from an external library is a bad idea, even if it might occasionally work.

Off: if you wish to use Linux(ish subsystem) within Windows, use WSL1 with Ubuntu.

Off: `su`, `sudo`, `run` and other commands you tried in your Cygwin screenshot are completely off-topic.

Last edited by NevemTeve; 01-23-2024 at 02:42 AM.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How does a c program see the variable declared in a lex & yacc file carlnet Linux - General 2 04-11-2012 03:31 AM
implementing calculator program in lex and yacc but getting syntax error Avanti Linux - Newbie 1 10-27-2011 10:27 AM
LXer: XenSource's Levine And Citrix's Wasson Explain Future Virtualization Moves LXer Syndicated Linux News 0 08-24-2007 12:13 AM
Error in Makefile for Lex and Yacc oulevon Programming 2 10-24-2005 12:52 AM
Lex & yacc Programming in linux. hemanexp Linux - Software 2 01-07-2004 11:09 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration