EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

include, #use, create own library or header file

Started by wannasseayp February 17, 2005

Hi all,

Does anyone know how to include header file or library file in dynamic
C version 7.32P?
What i have been doing is i create only one "c" file for my BL2000
board . Now, i want to be able to reuse or call my functions from
anywhere or any files that i would create in the future. This means i
need to creat a header file. I tried to use "#use "mylib.lib"", but it
doesnt seem to work for me. I had include "mylib.lib" in LIB folder
and include "mylib.lib" by inserting line #use "mylib.lib" in
DEFAULT.lib under LIB folder in Dynamic C version 7.32P.
It must be a way that i can create more than one C files and create a
header file for my functions; so, i can call my functions from
somewhere else.
Please help.
Thank you,


You need to edit the lib.dir file which is usually found with the
DCRABBIT_x.xx directory. You must include the full path and name of your
lib file. Once you've done this, you can #use the lib file in any .C file.

Regards
Peter Clark

-----Original Message-----
From: wannasseayp [mailto:wannasseayp@wann...]
Sent: Thursday, 17 February 2005 7:34 p.m.
To: rabbit-semi@rabb...
Subject: [rabbit-semi] include, #use, create own library or header file
Hi all,

Does anyone know how to include header file or library file in dynamic C
version 7.32P?
What i have been doing is i create only one "c" file for my BL2000 board .
Now, i want to be able to reuse or call my functions from anywhere or any
files that i would create in the future. This means i need to creat a header
file. I tried to use "#use "mylib.lib"", but it doesnt seem to work for me.
I had include "mylib.lib" in LIB folder and include "mylib.lib" by inserting
line #use "mylib.lib" in DEFAULT.lib under LIB folder in Dynamic C version
7.32P.
It must be a way that i can create more than one C files and create a header
file for my functions; so, i can call my functions from somewhere else.
Please help.
Thank you,

Yahoo! Groups Links

--
--



Hi

My english is poor, but i will try help you.
On Dinamic C we have not #include, instead it we use #use (think you know it).
We can have only a file .c anoters will be .lib that will be attached
to .c with #use clause.
To make a lib visible is needed that it have reference in lib.dir
file. On my installation of Dinamic C lib.dir is on D:\dcrabbit\.
Think that the only fail is that you put not a reference on lib.dir.

hope that i help zuzbr /> from Brasil (Brazil) On Thu, 17 Feb 2005 06:33:50 -0000, wannasseayp <wannasseayp@wann...> wrote:
>
>
> Hi all,
>
> Does anyone know how to include header file or library file in dynamic
> C version 7.32P?
> What i have been doing is i create only one "c" file for my BL2000
> board . Now, i want to be able to reuse or call my functions from
> anywhere or any files that i would create in the future. This means i
> need to creat a header file. I tried to use "#use "mylib.lib"", but it
> doesnt seem to work for me. I had include "mylib.lib" in LIB folder
> and include "mylib.lib" by inserting line #use "mylib.lib" in
> DEFAULT.lib under LIB folder in Dynamic C version 7.32P.
> It must be a way that i can create more than one C files and create a
> header file for my functions; so, i can call my functions from
> somewhere else.
> Please help.
> Thank you, > Yahoo! Groups Links




Thanks Peter and Zuzfor your help.
I get it to work now.
cheers
Wanna,



It's not mandatory that your files have the .lib extend
You can use any type of extend , I use .c for ALL my files.
The files of DC lib directory are the only lib files for my projects.

Two rules:
Add the exact and absulute path name of your files in lib.dir file
Respect exactly the syntax of lib files for declare functions and variables

extract of my lib.dir file
....
LIB\ADDON\UDPDEBUG.LIB
LIB\ADDON\SERDOWNL.LIB
E:\PROJETS\RABBIT\ELM\SOURCES\IO_B18.C
E:\PROJETS\RABBIT\ELM\SOURCES\IO_PROTO.C
E:\PROJETS\RABBIT\ELM\LIB\I2C.LIB
....


and extract of   E:\PROJETS\RABBIT\ELM\SOURCES\IO_B18.C

/*** BeginHeader InitPortIO */
void InitPortIO();
/*** EndHeader */
void InitPortIO()
{
...
...
}

José Luis Segatto Junior a écrit :
Hi

My english is poor, but i will try help you.
On Dinamic C we have not #include, instead it we use #use (think you know it).
We can have only a file .c anoters will be .lib that will be attached
to .c with #use clause.
To make a lib visible is needed that it have reference in lib.dir
file. On my installation of Dinamic C lib.dir is on D:\dcrabbit\.
Think that the only fail is that you put not a reference on lib.dir.

hope that i help zuzé
from Brasil (Brazil)

-------------------------------
* tel: 01 39 04 29 53 *
* r...@webdyn.com *
-------------------------------



The 2024 Embedded Online Conference