Hi all
In every compiler I have used, there has always been the need to include any functions used from within libraries, such as #include "stdio.h" etc.
So when using functions like sprintf why is there no include statement and how are these files or functions loaded ?
thanks Roy
#include
Re: #include
Hi,spectric wrote:Hi all
In every compiler I have used, there has always been the need to include any functions used from within libraries, such as #include "stdio.h" etc.
So when using functions like sprintf why is there no include statement and how are these files or functions loaded ?
thanks Roy
That is exactly the point of mikroC, to make it easier for you. The library functions for the selected mcu are loaded when the mcu is selected in compilers IDE, no need for any includes. The list of the library functions available for selected mcu are in the appropriate .mlk file located in the defs folder of the compiler. You can add your own function to the library by placing .c file into uses folder of the compiler and adding its name into the .mlk file under #Setlib pragma.
Hi there
There has to be a point where it might be easier but it has adverse effects on readability, not to mention portability.
With the use of include statements you could easily see at a glance what librarys were being used for the compilation, everything was transparent.
I suppose it does not help that I come from a background where you were expected to do everything, this included writing " makefiles " to tell the compiler what to do !
So would it be feasable to be given a choice, ie as it is or to manually include the files required ?
There has to be a point where it might be easier but it has adverse effects on readability, not to mention portability.
With the use of include statements you could easily see at a glance what librarys were being used for the compilation, everything was transparent.
I suppose it does not help that I come from a background where you were expected to do everything, this included writing " makefiles " to tell the compiler what to do !
So would it be feasable to be given a choice, ie as it is or to manually include the files required ?
all the best Roy
Re: #include
Hello sdrjan,
Thank you for your earlier reply. it seems quite important.
but can you tell me where is that .mkl file ?
I searched in my working directory. there are several sile versions but not .mlk which i need to include my .c file.
Hoping a soon reply.
Thank you.
Thank you for your earlier reply. it seems quite important.
but can you tell me where is that .mkl file ?
I searched in my working directory. there are several sile versions but not .mlk which i need to include my .c file.
Hoping a soon reply.
Thank you.