#include

General discussion on mikroC for dsPIC30/33 and PIC24.
Post Reply
Author
Message
spectric
Posts: 74
Joined: 05 Jan 2007 20:12
Location: Cumbria, Uk

#include

#1 Post by spectric » 18 Jan 2007 20:19

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
all the best Roy

User avatar
srdjan
mikroElektronika team
Posts: 1552
Joined: 28 Dec 2005 12:47
Location: Serbia

Re: #include

#2 Post by srdjan » 19 Jan 2007 08:56

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
Hi,
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.

spectric
Posts: 74
Joined: 05 Jan 2007 20:12
Location: Cumbria, Uk

#3 Post by spectric » 19 Jan 2007 22:02

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 ?
all the best Roy

User avatar
srdjan
mikroElektronika team
Posts: 1552
Joined: 28 Dec 2005 12:47
Location: Serbia

#4 Post by srdjan » 22 Jan 2007 08:44

Hi,
If the portability is an issue, you can use includes as far as you make files that should be included. As far as mikroC is concerned these files can be empty.

Anuradha
Posts: 40
Joined: 16 Apr 2010 16:13

Re: #include

#5 Post by Anuradha » 28 Apr 2010 09:25

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.

Post Reply

Return to “mikroC for dsPIC30/33 and PIC24 General”