Undefined reference error, basic ANOYING problem

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Undefined reference error, basic ANOYING problem

1,543 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by zanak on Sat May 19 07:47:42 MST 2012
Hello,
I'm trying to modify a project example included with the lpcxpresso IDE, when I try to include a header file (gpio.h) I get the undefined reference error to any function in this file (i.e GPIOInit, GPIOSetDir ...)

I tried to deselect the Exclude from build for the driver directory but without success !

any hint please !
0 Kudos
Reply
8 Replies

1,522 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by zanak on Sat May 19 14:47:56 MST 2012
well thank you the problem was in the #ifdef so the gpio.h wasnt included. now the project compiles with no errors. I'll debug it later and keep you updated.

"But don't mix different CMSIS versions if you are not familiar with this stuff.

I'll not help you to create nonsense projects :rolleyes:                    [IMG]http://knowledgebase.nxp.com/images/buttons/quote.gif[/IMG]"

you are right I was so frustrated I tried every possible option and didn't realized that I'm mixing stuff !
thank Mr Zero , it was really helpful
0 Kudos
Reply

1,522 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Sat May 19 14:20:10 MST 2012

Quote: zanak
yes I included it again,  and  no i didnt chane any thing in any file. except the main.c-




Your gpio files are still including:

#if CONFIG_ENABLE_DRIVER_GPIO==1

Change that :mad:

You new project is a catastrophic mixture of old linker script file with own old CMSIS1.3 and new included CMSIS2.0. If you want to create a new project, throw this old stuff away :eek: You don't need linker scripts for LPC11C any more :)
But don't mix different CMSIS versions if you are not familiar with this stuff.

I'll not help you to create nonsense projects :rolleyes:
0 Kudos
Reply

1,522 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by zanak on Sat May 19 13:53:49 MST 2012
yes I included it again,  and  no i didnt chane any thing in any file. except the main.c-

I tried to build a new project from the new project wizard , and the errors are gone but the linker can't find the entry symbol to ResetISR.

"cannot find entry symbol to ResetISR; defaulting to 0000000"

here is the zip file
0 Kudos
Reply

1,522 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Sat May 19 13:48:38 MST 2012
Folder 'driver' is excluded from build :eek:

Did you include this folder again ?

Both files (gpio.h, gpio.c) are including
#if CONFIG_ENABLE_DRIVER_GPIO==1
Did you change this to
#if 1
0 Kudos
Reply

1,522 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by zanak on Sat May 19 13:25:19 MST 2012
=)
Okey sorry. I'll try to explain it better,
I'm using the LPC11C24. and trying to add some IO control to the canopen_onchip. all I did is adding
#include "gpio.h"

and then made a call to GPIOInit();
the compiler can locate the gpio.h but rises a error flag on the GPIOInit() .

I can upload the project files and the .map if you'd like to .
thanks for your replies

--- Edit
the project files are now uploaded
0 Kudos
Reply

1,522 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Sat May 19 13:06:59 MST 2012
Sorry, can't follow you. Don't know which mcu, which sample and which project settings you are running :rolleyes:

If you want more than a guess you should export and post your project :)
0 Kudos
Reply

1,522 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by zanak on Sat May 19 12:46:31 MST 2012
actually I didnt make any change in the source location, all files still in the driver folder. and no there is no #ifdefs it's just the sample code from lpcxpresso.
it's kind of bizarre , I used to work with eclipse a long time ago, never faced this kind of voodoo problem !
0 Kudos
Reply

1,522 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Sat May 19 12:05:48 MST 2012
And where's your gpio.c?

And if it's in your source folder, are it's functions exluded with #ifdefs?
0 Kudos
Reply