Warnings file name and main function

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

Warnings file name and main function

#1 Post by spectric » 19 Feb 2022 12:52

I have these two warnings that I just cannot trace back to where the issue lies, but compilation is successful. I have now gone right back to basics and have a new project with nothing in it, removed all files except one with MAIN in it. I am still getting the same warnings.

0 304 object file name [P30F4013.c] does not match source file name []

0 357 main function is not defined

The other issue is that I cannot setup the file directories, the program rather than look in my working directories keeps going back to the C:/ where the program is installed.

Thanks Roy Oxlade
all the best Roy

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

Re: Warnings file name and main function

#2 Post by spectric » 20 Feb 2022 15:01

Hi there

Well eventually myself and some associates have got to the bottom of this issue, we are all old school programers and used to working in a certain way which is why this issue arose. What I had was a modified P30F4013.c file and the P30F4013.MLK file in my working directory but the system does not like this, putting these back into the DEFs folder in the program instalation directory resolves this issue with the errors, in both cases compilation was ok. This issue could also be resolved if there was a way to setup the directories for the CPU defintion files.

My next issue is that I need some confirmation regarding the keyword " register " which the help information says is just ignored by the compiler, in which case I have now changed to using sfr instead and as an example are using this for the PMD2 instead, please confirm this is ok with the Mikroe compiler.

/* PMD2: Peripheral Module Disable Register 3 */
sfr volatile unsigned int PMD2 absolute 0x0772;
typedef struct tagPMD2BITS {
unsigned OC1MD :1;
unsigned OC2MD :1;
unsigned OC3MD :1;
unsigned OC4MD :1;
unsigned :4;
unsigned IC1MD :1;
unsigned IC2MD :1;
unsigned :4;
unsigned IC7MD :1;
unsigned IC8MD :1;
} PMD2BITS;
sfr volatile PMD2BITS PMD2bits absolute 0x0772;

One last thing, I have the book written by Dogan Ibraham, it is a really good book but is there a newer version that would include the latest Mikroe compilers and the non ANSI compliant terms like rx, sfr, sbit etc that could really do with some in depth explanation.

thanks Roy
all the best Roy

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: Warnings file name and main function

#3 Post by filip » 21 Feb 2022 14:34

Hi,
My next issue is that I need some confirmation regarding the keyword " register " which the help information says is just ignored by the compiler, in which case I have now changed to using sfr instead and as an example are using this for the PMD2 instead, please confirm this is ok with the Mikroe compiler.

Code: Select all

/* PMD2: Peripheral Module Disable Register 3 */
sfr volatile unsigned int PMD2 absolute 0x0772;
typedef struct tagPMD2BITS {
unsigned OC1MD :1;
unsigned OC2MD :1;
unsigned OC3MD :1;
unsigned OC4MD :1;
unsigned :4;
unsigned IC1MD :1;
unsigned IC2MD :1;
unsigned :4;
unsigned IC7MD :1;
unsigned IC8MD :1;
} PMD2BITS;
sfr volatile PMD2BITS PMD2bits absolute 0x0772; 
Yes, this is OK, but please have in mind that PMD2 is already defined in the definition file
One last thing, I have the book written by Dogan Ibraham, it is a really good book but is there a newer version that would include the latest Mikroe compilers and the non ANSI compliant terms like rx, sfr, sbit etc that could really do with some in depth explanation.
I guess this is a question for mr Dogan Ibrahim, I will see if I can pass your remark to the right address.

Regards,
Filip.

Post Reply

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