Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Can't figure out why two of my files will not link

Status
Not open for further replies.

leech20e

New Member
Here is the output in MPLAB. All files compile fine, just will not link the custom intcnv.h and intcnv.c files together. Any ideas?

----------------------------------------------------------------------
Debug build of project `C:\Users\Eric\Documents\MPLAB\FREQ_COUNTERv3.0\FREQv3.0.mcp' started.
Language tool versions: mpasmwin.exe v5.42, mplink.exe v4.40, mcc18.exe v3.40, mplib.exe v4.40
Preprocessor symbol `__DEBUG' is defined.
Sun Mar 04 11:48:46 2012
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Deleted file "C:\Users\Eric\Documents\MPLAB\FREQ_COUNTERv3.0\main.o".
Clean: Deleted file "C:\Users\Eric\Documents\MPLAB\FREQ_COUNTERv3.0\intcnv.o".
Clean: Done.
Executing: "C:\Program Files\Microchip\mplabc18\v3.40\bin\mcc18.exe" -p=18F4520 "main.c" -fo="main.o" -D__DEBUG -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
Executing: "C:\Program Files\Microchip\mplabc18\v3.40\bin\mcc18.exe" -p=18F4520 "C:\Users\Eric\Documents\MPLAB\FREQ_COUNTERv2.0\intcnv.c" -fo="intcnv.o" -D__DEBUG -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
Executing: "C:\Program Files\Microchip\mplabc18\v3.40\bin\mplink.exe" /p18F4520 /l"C:\Program Files\Microchip\mplabc18\v3.40\lib" "main.o" "intcnv.o" /u_CRUNTIME /u_DEBUG /z__MPLAB_BUILD=1 /z__MPLAB_DEBUG=1 /m"FREQv3.0.map" /w /o"FREQv3.0.cof"
MPLINK 4.40, Linker
Device Database Version 1.3
Copyright (c) 1998-2011 Microchip Technology Inc.
Error - symbol 'Greeting' has multiple definitions.
Errors : 1

Link step failed.
----------------------------------------------------------------------
Debug build of project `C:\Users\Eric\Documents\MPLAB\FREQ_COUNTERv3.0\FREQv3.0.mcp' failed.
Language tool versions: mpasmwin.exe v5.42, mplink.exe v4.40, mcc18.exe v3.40, mplib.exe v4.40
Preprocessor symbol `__DEBUG' is defined.
Sun Mar 04 11:48:47 2012
----------------------------------------------------------------------
BUILD FAILED


This code is the .c file

Code:
/*
INTCNV.C
*/


#ifndef CLASS_H
#include "class.h"
#endif
#include "lcd.h"
#include "intcnv.h"

void SortNum(int num) //Taken out the function definition to shorten code

void PrntNum(int A) //Same ^

This file is the .h file associated

Code:
/*
INTCNV.H
*/

#ifndef INTCNV_H
#define INTCNV_H

void PrntNum(int A);
void SortNum(int num);
 
You need to post the whole code. If it's not used it will not include it. With some compilers
but you can't really see what's happening with what you posted.
 
I believe I figured out the problem. Trying to reference other functions from different .c files in the project files. Seems that is a no no. Will have to write all functions as struct functions to use them in a function within a function.
 
Great that looked like what was happening on one error but it's hard to tell with out all your code.

Glade you figured it out .
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top