Hello people!
I’m starting my way programming in c, and made my first steps using Notepad++. Everything was ok, but then I saw that with Acsim i could test my apps without flashing the pic. So, following the instructions in the wiki I started to setup Codeblocks and all the needed other things for ACsim to work.
It’s been complicated, but everything seems to be right. Everything but:
I have a project based on mclock, where there’s main.c and mtc.c, with their respective headers.
When I try to bulid the project, either as debug or release I get the error:
error: missing definition for symbol “_MTC_DoRew”, required by “_output\main.o”
error: missing definition for symbol “_MTC_DoStop”, required by “_output\main.o”
error: missing definition for symbol “_MTC_DoPlay”, required by “_output\main.o”
error: missing definition for symbol “_mtc_state”, required by “_output\main.o”
error: missing definition for symbol “_MTC_Timer”, required by “_output\main.o”
error: missing definition for symbol “_MTC_Tick”, required by “_output\main.o”
error: missing definition for symbol “_MTC_Init”, required by “_output\main.o”
error: missing definition for symbol “_MTC_DoFwd”, required by “_output\main.o”
error: missing definition for symbol “_MTC_FPSSet”, required by “_output\main.o”
error: missing definition for symbol “_MTC_DoPause”, required by “_output\main.o”
error: missing definition for symbol “_mtc_long_timeMSW”, required by “_output\main.o”
error: missing definition for symbol “_mtc_long_timeLSW”, required by “_output\main.o”
ERROR!
Process terminated with status 1 (0 minutes, 1 seconds)
0 errors, 1 warnings
It seems it cannot find the definitions in mtc.h
Although they are just as they were when using Notepad++ and there was no trouble at all.
I copy the start of main.c, and some parts of mtc.h
////////////////////////////////////////////////////////////////////////////
// Include files
/////////////////////////////////////////////////////////////////////////////
include “main.h”
include “mtc.h”
//#include <cmios.h>
//#include <pic18fregs.h>
#ifndef _DEBUG_C
include “cmios.h”
include “pic18f452.h”
#endif
mtc.h:
#ifndef _MTC_H
#define _MTC_H
/////////////////////////////////////////////////////////////////////////////
// Global definitions
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// Global Types
/////////////////////////////////////////////////////////////////////////////
// status of MTC
typedef union {
struct {
unsigned ALL:8;
};
struct {
unsigned RUN:1;
unsigned PAUSE:1;
unsigned START_REQ:1;
unsigned STOP_REQ:1;
unsigned CONT_REQ:1;
};
} mtc_state_t;
/////////////////////////////////////////////////////////////////////////////
// Prototypes
/////////////////////////////////////////////////////////////////////////////
void MTC_Init(void);
void MTC_Tick(void);
void MTC_Timer(void);
void MTC_FPSSet(unsigned char rate);
unsigned char MTC_FPSGet(void);
void MTC_ResetMeter(void);
void MTC_SendMeter(void);
void MTC_DoStop(void);
void MTC_DoPause(void);
void MTC_DoPlay(void);
void MTC_DoRew(void);
void MTC_DoFwd(void);
unsigned int MTC_GetTimerValue(unsigned char rate);
____________________________
As you can see, mtc.h is included in main.c, an the functions not found by the linker are declared in mtc.h. So, it’s puzzling me beyond my efforts. I know it must be some stupid thing I’m overlooking, but, well, I spent many hours and couldn’t find a solution.
Thanx for your wise advice
Pablo