guide to creating your own libraries in mC
guide to creating your own libraries in mC
Could you give a guide to creating your own libraries in mC it doesn’t seem to pick up my library files if I just copy the mcl files into the uses folder.
Graham Ambrose
Re: guide to creating your own libraries in mC
This (copy/paste to the <Uses> dir) should work. You might have named your libraries in an 'unfortunate' manner, e.g. to end with C_F, or E_A or similar (take a look in the <Defs> files).
BTW, if you're testing your libraries from within the same project you used to create them, don't forget to exclude their sources from the project.
BTW, if you're testing your libraries from within the same project you used to create them, don't forget to exclude their sources from the project.
pizon
My library is called “P16_Decimal_2_BCD.mcl” and I have copied and pasted to the uses/P16 dir, I’m using a P16F877A
And I have excluded the original source file.
But get:
And I have excluded the original source file.
But get:
- Undeclared identifier[Short2BCD] in expression
Undeclared identifier[Int2BCD] in expression
Undeclared identifier[Long2BCD] in expression
Graham Ambrose
Name of your library may not contain underscores (_) if you want compiler to load it automatically. There are special (rather obscure) rules how compiler loads libraries with underscores in their names.gambrose wrote:My library is called “P16_Decimal_2_BCD.mcl” and I have
Now, I would advise you to be patient, and wait till April. In new version, we'll try to keep it as simple and clear as possible. All this we discussed here will be changed with new linker, so this knowledge might prove to be useless within 3-4 weeks.
-
In V.2 we made changes. In Defs folder you have files of type *.mlk for eachgambrose wrote:Can't seem to get mikroC to see I library I created with it.
I called it BCD16.
PIC. All you have to do is to add to wanted chip *.mlk next line
Code: Select all
#pragma SetLib(name_of_Library_no_extesion)
Is it possible to put
in the code of the project you what to use the library for rather than the chip *.mlk file?
Code: Select all
#pragma SetLib(name_of_Library_no_extesion)
Graham Ambrose
for now not, maybe next versiongambrose wrote:Is it possible to put
in the code of the project you what to use the library for rather than the chip *.mlk file?Code: Select all
#pragma SetLib(name_of_Library_no_extesion)
I tried to install a mikroC library file i wrote in mikroBasic but i haven't been able to get it to work.
I have copied the mcl files to mikroBasic/uses/p16
and edited the mlk file to add #pragma statement.
but mikroBasic dose not recognize the function names in the library.
I am right in thinking that this should work aren't i
I have copied the mcl files to mikroBasic/uses/p16
and edited the mlk file to add #pragma statement.
but mikroBasic dose not recognize the function names in the library.
I am right in thinking that this should work aren't i
Graham Ambrose