what's wrong in my code?

Status
Not open for further replies.

perpetual_dream

New Member
Hi,
Ive tried to build a project in MPLAB and got the following error
PLINK 4.02, Linker
Copyright (c) 2006 Microchip Technology Inc.
Error - section '.config' type is non-overlay and absolute but occurs in more than one input file.
Errors : 1

It's my first project in MPLAB. I checked MPLAB's tutorial I added the following files:
Header files : PIC16F628
Linker scripts: 16f628.lkr
source files: f628tmp.asm + tut 7_5.asm
this how my work space looks like:
 

Attachments

  • pic_rs232.JPG
    59.4 KB · Views: 250
I just had that. I believe it means the declarations for fuse bits (oscillator type, brownout detection, etc) have been found a second time. Also it might be for EEPROM data but I don't think so.

Either you have 2 files like this, or more likely you have one file getting compiled twice. Most likely is you did the declarations in a header (*.h) file without protection against repetition and included it in more than one *.c file.

To protect against repetition:
myconfig.h:
Code:
#ifdef _MYCONFIG_H_
#define _MYCONFIG_H_

//set config bits
#define MYVAR 5
//etc etc

#endif

edit:
ok sorry I thought you were doing C. But it may be a similar prob.
 
Hi,
Look in the other place you asked this question. I think it is that your code is assembled in absolute mode, rather than relocatable. You should probably remove the linker file, or lay out your code as relocatable.

Regards,
Robert
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…