Question

I'm a newbie so be easy.

I'm "trying" to build a LCD test program which was given to me by an instructor that uses the XLCD.h and Delays.h headers. Problem is that the headers don't seem to be linked during the build process as the compiler keeps tossing me an error about a function not being defined.

MPLINK 4.42, Linker Device Database Version 1.7 Copyright (c) 1998-2011 Microchip Technology Inc. Error - could not find definition of symbol 'SetDDRamAddr' in file './LCD_Main.o'. Errors : 1

I used the Project Wizard and selected my chip...added the .lnk file for my chip, added the .h files for xlcd and delays, added the p18cxxx.h file.
The test code is tried and true. I've done the #include at the top and I've even put the file in the same directory and then used #include "xlcd.h" but nothing seems to work for me.

Yes, I've double tripple checked the syntax for errors and eventually just copied and pasted from the header file to the main.c so it's not that.

Looking at the error it seems to me that only the prototype might be being seen and not the defined function. I thought that was all done with magic in the background so I have no idea how to check for paths or even if it is happening.

As the whole thing is a bit of a walkthru I figured it should be straight forward but it's not.

I'm sure it must just be a simple fix but I've been working on it for hours now and I'm getting ready to drop kick the stupid protoboard and PIC across the room.

Anybody have an idea what I could be doing wrong?

Thanks

Was it helpful?

Solution

You need to point the linker to the proper library.

Go to Project->Build Options. Select the Directories tab. On the Show Directories For combobox, select Library Search Path. Click New.

Then, select the directory that has your libraries. For C18 it's likely (on Windows 7):

C:\Program Files (x86)\Microchip\mplabc18\v3.41\lib

You should then be able to link without problem.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top