need central way for #include "c:\extern\files.h"

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am
Has thanked: 493 times
Been thanked: 187 times

need central way for #include "c:\extern\files.h"

Post by Rudi »

Hi Guys,

i need a help.

I do make a MPLAP Projekt transfer to FC.
In the main.c there are defines for variable, struct and others.
The main.h have declaration of prototypes .

Example - functions are in button.c the declaration of prototypes in button.h
..

if i make a Makro of the function with c icon, the compiler do not know how the prototypes are define..
so i make a first c icon with #include "c:\extern\button.h" in the Makro and then is ok.

but this makro is only one function of the button.c.
so i make a new makro for the next function and again, a c icon for the #include "c:\extern\button.h".

the next, if i need a return from this function in the c icon in a makro,
how can i point to this return?

i can make a variable in FC, and in the makro in c icon i can define this to the FC Variable..
but i only what make a Pointer to this - is this possible?

is there a way to make the #include "c:\extern\button.h" central ?

if i need a variable from main c icon,( Struct ... ) the function in makro do not know about too.
how can i tell the function ( makro ) about the variable in main as c icon?

i hope my question is clear.

Thank you!

Rudi

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: need central way for #include "c:\extern\files.h"

Post by LeighM »

Build->Project Options->General Options
click Use supplementary code
click Supplementary Code button
and add your #include "c:\extern\button.h" to the Definitions section
you can also add global variables there too

Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am
Has thanked: 493 times
Been thanked: 187 times

Re: need central way for #include "c:\extern\files.h"

Post by Rudi »

LeighM wrote:Build->Project Options->General Options
click Use supplementary code
click Supplementary Code button
and add your #include "c:\extern\button.h" to the Definitions section
you can also add global variables there too

Hi Leigh

thank you i will try at evenning.
Leigh, a question, is this for my other question "struct" for all macros

http://www.matrixtsl.com/mmforums/viewt ... =7&t=15058

the same way?
Thank you!!

Best wishes
Rudi
;-)

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: need central way for #include "c:\extern\files.h"

Post by Benj »

Hi Rudi,

The top box is for includes and prototypes.

e.g.

Code: Select all

#include "c:\extern\button.h"

char addVars (char a, char b);
The bottom box is for your functions.

e.g.

Code: Select all

char addVars (char a, char b)
{
return a + b;
}

Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am
Has thanked: 493 times
Been thanked: 187 times

Re: need central way for #include "c:\extern\files.h"

Post by Rudi »

Best thank Benj and Leigh!!!

The weekend is saved ;-)
I must go one and make now ..
I give you an update again on Monday
I hope that I have the project transferred by then.
wish me good luck ;-) and squeezes my thumb - this will be my resume ;-)
i have learn many from you, your staff and VC's last month in FC and programming tips.

Best wishes!!!
Rudi
;-)

Post Reply