Re: [SLE] Install source



On Saturday 02 September 2006 05:06, Harshal Shah wrote:
when i work with lex & yacc on novelsuse 10 ent. i found that i can
compile lexspecification file.l completely. It generates lee.yy.c .
In other linux we are able to compile lex.yy.c with command

"$ cc lex.yy.c -ll " then we see output "./a.out" . but in novelsuse
10 this command ("$ cc lex.yy.c -ll ") is not working & showing error
with collect2 id and not having "-ll" option.

We'll need the whole compilation/link error to know for sure. Try
compiling without -ll, as that library contains only a stub main()
routine which calls the lexer (if i recall correctly).

Something to try:

cc -o foo.o lex.yy.c

If that works, the code compiles. Then try:

cc -o foo foo.o

If that fails, it's probably because your program doesn't have a main()
routine. If that happens, you can try adding the following code to a
separate file (main.c, taken from the flex info pages):

#include <stdio.h>

main( int argc, char ** argv )
{
++argv, --argc; /* skip over program name */
if ( argc > 0 )
yyin = fopen( argv[0], "r" );
else
yyin = stdin;


yylex();
}


compile that with:

cc -o main.o main.c

And link it to your flexer with:

cc -o test main.o foo.o

If that works, the problem is simply that you don't need -ll but you
need to provide a main() routine to the flex-generated code.

suggest me what to do. how can i compile this in NovelSuse 10.

If you can send me the lex file off-list i can try it out on my 10.1
box. The problem may be related to differing flex versions on different
environments. Distros are starting to ship versions of flex newer than
2.5.4, and not all of those releases actually generate compilable code.
i believe that a collect2 error is a link error, though.


--
----- stephan@xxxxxxxx http://s11n.net
"...pleasure is a grace and is not obedient to the commands
of the will." -- Alan W. Watts

Attachment: pgpNvGm88tbXV.pgp
Description: PGP signature



Relevant Pages

  • Re: A programming wiki?
    ... user 2, change routine xx, so it becomes version 1.1. ... By inspecting the changes others made, user1 can upgrade his routines if he wants to. ... Or the other users could just compile the new version, and see for themself if they want the added stuff or not. ... You may upgrade rights by way of contributions. ...
    (alt.lang.asm)
  • Re: Finally upgrading to Clipper 5.3 from S87
    ... I wrote a small routine that erases my old NTX ... Applying MODIFY File Patch for 'BLINKER.TXT' ... > I compile and link from a dos window. ... > As to the patches, I have downloaded patches 5.3A and 5.3B. ...
    (comp.lang.clipper)
  • Re: C on z/OS questions -- Thanks!
    ... The information provided was of great worth and I was able to get the routine ... In order to compile the routine we have had to replace all our square ... For IBM-MAIN subscribe / signoff / archive access instructions, ... send email to listserv@xxxxxxxxxxx with the message: GET IBM-MAIN INFO ...
    (bit.listserv.ibm-main)
  • Re: C on z/OS questions
    ... I need to be able to have this routine dynamically linked at run time if/when ... I need to be able to compile and link this ... pre-link proc step and a link proc step. ... For IBM-MAIN subscribe / signoff / archive access instructions, ...
    (bit.listserv.ibm-main)
  • Re: How to avoid forward references in Modules?
    ... an external routine which then calls a routine in B. ... In order to compile the external ... interfaces) or you lose some functionality (implicit interfaces ...
    (comp.lang.fortran)