# Clarification on the header file

Status
Not open for further replies.

#### elecLear78

##### Member
I have seen in many microchip programs the following code
Code:
#if defined(__dsPIC33F__)
#include "p33Fxxxx.h"
#elif defined(__PIC24H__)
#include "p24Hxxxx.h"
#endif
But where are these __dsPIC33F__ or __PIC24H__ will be defined. In which file should I look into?

#### Ian Rogers

##### User Extraordinaire
Forum Supporter
With XC8/16/32 compilers, you only need XC.h as the processor type is obtained from the IDE and then XC8 /16/32 then produces an AS file ( assembly startup ) which defines the processor..

Most compilers used to allow ( and still do ) the inclusion of the correct header... XC8 and MikroC both do not need this to be defined..

#### elecLear78

##### Member
So in case if i import any sample project i should select the correct controller for that project then it automatically includes that header. Am i correct?

#### Ian Rogers

##### User Extraordinaire
Forum Supporter
Like I said... XC8 and MikroC allow automatic processor selection... I can't assume you are using a specific compiler / IDE.. MPIDE will pass the processor type to the compiler.. If you just include XC.H then it will auto detect. However! You can just specify the header by name.. ie.. #include <p24Hxxxx.h> and it will be found.. This is to simplify the coding process to the masses..

Status
Not open for further replies.

Replies
6
Views
2K
Replies
3
Views
9K
Replies
3
Views
2K
Replies
0
Views
2K
Replies
3
Views
2K