Pablop Posted May 29, 2009 Report Share Posted May 29, 2009 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.hAlthough 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 MTCtypedef 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 advicePablo Quote Link to comment Share on other sites More sharing options...
audiocommander Posted May 29, 2009 Report Share Posted May 29, 2009 Hi Pablo,I never used CodeBlocks, so I'm not sure if I can be of any help, but if it worked in Notepad++ but not in Codeblocks, I guess there might be something wrong with the make-process. With the old toolchain, one had to add additional classes to the Makefile (OBJS = mtc.o)... again, not sure if this is done automatically by adding files to a target in CodeBlocks...Best,Michael Quote Link to comment Share on other sites More sharing options...
Pablop Posted May 29, 2009 Author Report Share Posted May 29, 2009 Hi!If I understood you well, I took makefile and where it saidOBJS=$(OUTDIR)/pic18f452.o $(OUTDIR)/main.oI added mtc.o so it now readsOBJS=$(OUTDIR)/pic18f452.o $(OUTDIR)/main.o $(OUTDIR)/mtc.oSadly, I got the same error, and what's more, once the project is built, makefile returns to it's original state.thank you, anyway! Quote Link to comment Share on other sites More sharing options...
stryd_one Posted May 29, 2009 Report Share Posted May 29, 2009 Heya pablop :)So, following the instructions in the wikiYou mean this one ?Did you maybe use the template in the zip file from this section ? It's verrrry olllld and won't work... You should be able to follow the instructions for creating a new template found here though, but you will need to change at least one step:Where it says to type 'make.bat' you just type 'make'.There may be other changes required.... That documentation is quite old... Quote Link to comment Share on other sites More sharing options...
Pablop Posted June 11, 2009 Author Report Share Posted June 11, 2009 Thanx, Stryd, I followed your instructions and everything worked ok!I've just posted something about MIOS_Timer not working on GUISim, though, heh, there's always something new to stumble upon! ;-)CyaPablo Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.