EmbeddedRelated.com
Forums

Problem on RCM3700

Started by alekremer May 7, 2007
--- fakhre alam escreveu:

> Hi
>
> I created my own test.c file and I want to add my
> own
> lib file, TESTLCD.LIB, the main function is in
> test.c
> file. I want to compile TESTLCD.LIB so I can use
> function defined in that file in my test.c file
> (which
> include void main(void)). If you open GPS.lib it
> does
> not contain any void main (void).
Of course it does not contain the main function. It
is a .lib file...
> I tried with the
> info mentioned in Dynamic c 9.10 doc.
>
> #use "testlcd.lib" /* add to test.c */
>
> and add testlcd.lib in lib.dir
>
> Please let me know any thing else need to done.

Once you created a test.c file wich has the directive
#use testlcd.lib you only need to include the file and
its CORRECT PATH on lib.dir file.
Once you did that, close Dynamic C and open it again.
Try to compile your test.c file. It shall work.
>
> Thanks.
> Fakhre Alam
>
> --- Scott Henion wrote:
>
> > fakhre alam wrote:
> > > Hi
> > >
> > > Is any idea how to compile new lib and add it to
> > > rabbit lib. I tried to compile it on Dynamic
> 9.10,
> > > does not compile with out adding void main
> (void).
> > >
> > DC is not like a normal C compiler. It does not
> > support separate
> > compilation of libraries. When you compile your
> > program, your source and
> > all the libraries it uses are compiled at once.
> >
> > If writing a new lib, just add a "#use new.lib" to
> a
> > .c file with main()
> > and add new.lib to the lib.dir file.
> >
> > ------
> > | Scott G. Henion| s...@shdesigns.org |
> > | Consultant | Stone Mountain, GA |
> > | SHDesigns http://www.shdesigns.org |
> > ------
> > Rabbit libs: http://www.shdesigns.org/rabbit/
> > today's fortune
> > I don't think 'It's better than hurling yourself
> > into a meat grinder'
> > is a good rationale for doing something.
> > -- Andrew Suffield in
> > <2...@doc.ic.ac.uk> on
> > debian-devel
> >
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> __________________________________________________
>
>
__________________________________________________
Fale com seus amigos de gra com o novo Yahoo! Messenger
http://br.messenger.yahoo.com/
Thanks Alexandre, I will re-try it and see.

Fakhre Alam

--- Alexandre Kremer wrote:

>
> --- fakhre alam escreveu:
>
> > Hi
> >
> > I created my own test.c file and I want to add my
> > own
> > lib file, TESTLCD.LIB, the main function is in
> > test.c
> > file. I want to compile TESTLCD.LIB so I can use
> > function defined in that file in my test.c file
> > (which
> > include void main(void)). If you open GPS.lib it
> > does
> > not contain any void main (void).
> Of course it does not contain the main function.
> It
> is a .lib file...
> > I tried with the
> > info mentioned in Dynamic c 9.10 doc.
> >
> > #use "testlcd.lib" /* add to test.c */
> >
> > and add testlcd.lib in lib.dir
> >
> > Please let me know any thing else need to done.
>
> Once you created a test.c file wich has the
> directive
> #use testlcd.lib you only need to include the file
> and
> its CORRECT PATH on lib.dir file.
> Once you did that, close Dynamic C and open it
> again.
> Try to compile your test.c file. It shall work.
> >
> > Thanks.
> > Fakhre Alam
> >
> > --- Scott Henion wrote:
> >
> > > fakhre alam wrote:
> > > > Hi
> > > >
> > > > Is any idea how to compile new lib and add it
> to
> > > > rabbit lib. I tried to compile it on Dynamic
> > 9.10,
> > > > does not compile with out adding void main
> > (void).
> > > >
> > > DC is not like a normal C compiler. It does not
> > > support separate
> > > compilation of libraries. When you compile your
> > > program, your source and
> > > all the libraries it uses are compiled at once.
> > >
> > > If writing a new lib, just add a "#use new.lib"
> to
> > a
> > > .c file with main()
> > > and add new.lib to the lib.dir file.
> > >
> > > ------
> > > | Scott G. Henion| s...@shdesigns.org |
> > > | Consultant | Stone Mountain, GA |
> > > | SHDesigns http://www.shdesigns.org |
> > > ------
> > > Rabbit libs: http://www.shdesigns.org/rabbit/
> > > today's fortune
> > > I don't think 'It's better than hurling yourself
> > > into a meat grinder'
> > > is a good rationale for doing something.
> > > -- Andrew Suffield in
> > > <2...@doc.ic.ac.uk> on
> > > debian-devel
> > >
> > >
> > >
> > >
> > > Yahoo! Groups Links
> > >
> > >
> > >
> > >
> > >
> >
> >
> > __________________________________________________
> >
> >
> __________________________________________________
> Fale com seus amigos de gra com o novo Yahoo!
> Messenger
> http://br.messenger.yahoo.com/
>
> Yahoo! Groups Links
>
__________________________________________________
Hi

I solved the issue with how to add new lib, you have
to follow a specific format which not part of standard
c header file, seems like Rabbit have its own way to
declare the lib, you have to follow a strict lib
declaration format. Here is the example for future
reference

/*** Beginheader init_serial_port_lcd_controller */
void init_serial_port_lcd_controller(void);
/*** endheader */

/* START FUNCTION DESCRIPTION
********************************************
init_serial_port_lcd_controller


SYNTAX: init_serial_port_lcd_controller();

DESCRIPTION: Use to initialize seril portC.

PARAMETER1: None

RETURN VALUE: None

END DESCRIPTION
**********************************************************/

void init_serial_port_lcd_controller(void)
{
#define SERDIS_BAUD_RATE 2400

unsigned int baud_rate;

baud_rate = serCopen(SERDIS_BAUD_RATE);
serCparity(PARAM_NOPARITY);
serCflowcontrolOff();
serCdatabits(PARAM_8BIT);

if (baud_rate)
{
printf("open port c at baud rate = %d\n",
SERDIS_BAUD_RATE);
}
else
printf("port c can not be open\n");
}

/*** BeginHeader */

Thanks every one for all the help. Its was not the
issue of adding serlcd.lib to LIB.DIR and #use
"serlcd.lib", the problem is the format, you have to
follow the Rabbit lib declaration format, which kind
of fishy.

Thanks.
Fakhre Alam
--- Alexandre Kremer wrote:

>
> --- fakhre alam escreveu:
>
> > Hi
> >
> > I created my own test.c file and I want to add my
> > own
> > lib file, TESTLCD.LIB, the main function is in
> > test.c
> > file. I want to compile TESTLCD.LIB so I can use
> > function defined in that file in my test.c file
> > (which
> > include void main(void)). If you open GPS.lib it
> > does
> > not contain any void main (void).
> Of course it does not contain the main function.
> It
> is a .lib file...
> > I tried with the
> > info mentioned in Dynamic c 9.10 doc.
> >
> > #use "testlcd.lib" /* add to test.c */
> >
> > and add testlcd.lib in lib.dir
> >
> > Please let me know any thing else need to done.
>
> Once you created a test.c file wich has the
> directive
> #use testlcd.lib you only need to include the file
> and
> its CORRECT PATH on lib.dir file.
> Once you did that, close Dynamic C and open it
> again.
> Try to compile your test.c file. It shall work.
> >
> > Thanks.
> > Fakhre Alam
> >
> > --- Scott Henion wrote:
> >
> > > fakhre alam wrote:
> > > > Hi
> > > >
> > > > Is any idea how to compile new lib and add it
> to
> > > > rabbit lib. I tried to compile it on Dynamic
> > 9.10,
> > > > does not compile with out adding void main
> > (void).
> > > >
> > > DC is not like a normal C compiler. It does not
> > > support separate
> > > compilation of libraries. When you compile your
> > > program, your source and
> > > all the libraries it uses are compiled at once.
> > >
> > > If writing a new lib, just add a "#use new.lib"
> to
> > a
> > > .c file with main()
> > > and add new.lib to the lib.dir file.
> > >
> > > ------
> > > | Scott G. Henion| s...@shdesigns.org |
> > > | Consultant | Stone Mountain, GA |
> > > | SHDesigns http://www.shdesigns.org |
> > > ------
> > > Rabbit libs: http://www.shdesigns.org/rabbit/
> > > today's fortune
> > > I don't think 'It's better than hurling yourself
> > > into a meat grinder'
> > > is a good rationale for doing something.
> > > -- Andrew Suffield in
> > > <2...@doc.ic.ac.uk> on
> > > debian-devel
> > >
> > >
> > >
> > >
> > > Yahoo! Groups Links
> > >
> > >
> > >
> > >
> > >
> >
> >
> > __________________________________________________
> >
> >
> __________________________________________________
> Fale com seus amigos de gra com o novo Yahoo!
> Messenger
> http://br.messenger.yahoo.com/
>
> Yahoo! Groups Links
>

____________________________________________________________________________________
Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.
http://autos.yahoo.com/new_cars.html
This is an oddity of Dynamic C. Rather than header files, you put
function prototypes and any globals in between those Beginheader and
endheader tags. I'm sure that they have a description for a problem
that matches their solution, but it really is kind of odd. I can live
with it, but often stumble a few times as well. You have described
this better than the book!

Jon

--- In r..., fakhre alam wrote:
>
> Hi
>
> I solved the issue with how to add new lib, you have
> to follow a specific format which not part of standard
> c header file, seems like Rabbit have its own way to
> declare the lib, you have to follow a strict lib
> declaration format. Here is the example for future
> reference
>
> /*** Beginheader init_serial_port_lcd_controller */
> void init_serial_port_lcd_controller(void);
> /*** endheader */
>
>. . .