Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Compile LEX

I have a library that I am trying to compile (C) and it has a LEX file (.l) that gets compiled into a .c file.  It i'ts make file, it has:

xmlparse.c : xmlparse.l
	$(LEX) $(LEXFLAGS)  $<
	-@mv lex.yy.c xmlparse.c
	@echo Created xmlparse.c

 
Where LEX is defined as "flex" and nothing for LEXFLAGS.

 

Could not find how this should be done in the QNX Momentics IDE.  Anyone come across this? 

 

Developer
Posts: 162
Registered: ‎01-11-2012
My Device: BlackBerry 9790, BlackBerry PlayBook 64Gb, BlackBerry 10 Dev Alpha

Re: Compile LEX

Hi jtegen,

You can use makefile-driven project in NDK.
Respectfully,
Oleg

Developer, QNX RTOS, BlackBerry 10 and PlayBook
Follow me on Twitter (in Russian)
St.Petersburg BlackBerry Dev. Group
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: Compile LEX

There are some nice things in the IDE to manage the build, especially when it comes with simulator/debug/release/device deployment. Is there a way to add the instruction into the IDE settings?
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: Compile LEX

Anyone know how to get a LEX file to compile in the IDE?
Developer
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook

Re: Compile LEX

Just a thought: can you try to put:

lex xmlparse.l -@mv lex.yy.c xmlparse.c

in Project Options->C/C++ build->Settings->Build Steps->Pre-build steps->Command:

Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: Compile LEX

Tried that, including:
lex src/xmlparse.l -@mv lex.yy.c src/xmlparse.c

But it does not seem to build anything and I dont get an error.
Developer
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook

Re: Compile LEX

There was a post from Elena Laskavaya in this forum about build process customization (long time ago) but can't find it. -(( There should be a way to accomplish this...

BlackBerry Development Advisor
Posts: 15,019
Registered: ‎07-09-2008
My Device: BlackBerry Passport

Re: Compile LEX

[ Edited ]

Can you verify if lex is available on your path?  Have you tried using the fully qualified path?

 

Did you refresh the project after building?

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: Compile LEX

Where would lex be if it was not included in the IDE?
BlackBerry Development Advisor
Posts: 417
Registered: ‎10-27-2010
My Device: PlayBook

Re: Compile LEX

I think lex is shipped as part of toolchain. If you use "make" project (not managed) it should work from makefile,

if you want to use managed project, you can either try pre-build steps, or you can add another "builder" into

the project, and create a custom command (for example one which invoke make).

Alternative you can separate the code of parser into a static library and create another "make" project,

and make you managed project depend on that library.