these were the step for creating a library whit the old micro C version:
1) Create new C file (mikroC->File->New)
2) Save the file in one of the following folders:
C:ProgrammiMikroelektronikamikroCUsesP16
C:ProgrammiMikroelektronikamikroCUsesP18
If you are creating library for PIC16 MCU family the file should be saved in P16 folder.
If you are creating library for PIC18 MCU family the file should be saved in P18 folder.
If you are creating library for PIC16 and PIC18 MCU families the file should be saved in both folders.
3) Write the code for your library and save it.
4) Open the "mlk" file for the MCU that you want to use. The "mlk" file is placed in the following folder:
C:ProgramiMikroelektronikamikroCdefs
Add the following line in the definition file for the MCU:
#pragma SetLib(Your_Lib_ Name)
note: this step should be repeated for each MCU that you intend to use
5) Restart the compiler.
---
Best regards,
Goran Pavlovic
mikroElektronika Support Team
http://www.mikroe.com/
These steps with new version still work?.
Is there an other solution?.You can gives me an example.
make library with the new compiler..!!
Hi trasalb,
Adding/creating new library in mikroC PRO for PIC is done in this way:
Filip.
Adding/creating new library in mikroC PRO for PIC is done in this way:
- Create a new C source file, for example __Lib_Example.c.
- Save the file in one of the subfolders of the compiler's Uses folder:
DriveName:\Program Files\Mikroelektronika\mikroC PRO for PIC\Uses\P16\
DriveName:\Program Files\Mikroelektronika\mikroC PRO for PIC\Uses\P18\
If you are creating library for PIC16 MCU family the file should be saved in P16 folder.
If you are creating library for PIC18 MCU family the file should be saved in P18 folder.
If you are creating library for PIC16 and PIC18 MCU families the file should be saved in both folders. - Write a code for your library and save it.
- Add __Lib_Example file in some project, see Project Manager. Recompile the project.
- If you wish to use this library for all MCUs, then you should go to Tools > Options > Output settings,
and check Build all files as library box. This will build libraries in a common form which will work with all MCUs.
If this box is not checked, then library will be built for selected MCU.
Bear in mind that compiler will report an error if a library built for specific MCU is used for another one.
Compiled file __Lib_Example.mcl should appear in ...\mikroC PRO for PIC\Uses folder. - Open the definition file for the MCU that you want to use. This file is placed in the compiler's Defs folder:
DriveName:\Program Files\Mikroelektronika\mikroC PRO for PIC\Defs, and it is named MCU_NAME.mlk, for example P16F887.mlk.
Add the the following segment of code to <LIBRARIES> node of the definition file (definition file is in XML format):Code: Select all
<LIB> <ALIAS>Example_Library</ALIAS> <FILE>__Lib_Example</FILE> <TYPE>REGULAR</TYPE> </LIB>
- Add Library to mlk file for each MCU that you want to use with your library.
- Click Refresh button in Library Manager
- Example_Library should appear in the Library manager window.
Filip.
make library now it's possible..!
thank you so much of your help,now everything is OK....!!!!