Hi , I have using the MCUXpresso IDE ( latest version from the NXP website ) and also MCUXpresso SDK ( also latest version from the website) . I used I2C examples as a starting base . I want to add in some external files that I need to use for a project into this I2C examples project .
I want to create a new folders in the I2C projects and all the new files will be stored under this new folder . I have modify the I2C code so that it can call some function from the new software component that I have just added .
I have added the new files into the project and also put in the correct include path setting in the IDE to point to the new folder where all the new files are , I was able to compile but cannot link . It always indicated " undefined reference to” .
I have checked all my include headers for the calls that I have made , it is correct . but still I am having the same "undefined reference to”
But when I put the new folder with its new files under a already created folder from the I2C examples , it can compile and linked .
I suspect that if a new folder is created for the project, somehow it cannot recognise the new folder . The new folder has to be put into the already created folder from the examples . I give a example for better clarify
Original SDK project examples
Frdmke06z_i2C_polling_b2b_trasnsfer_master
>Project setting
>Includes
>CMSIS
>board
>component
>device
>source
>startup
>utilities
>debug
>doc
>newfolder
If the "newfolder” is created like the above , it will have the error "undefined reference to”
If the "newfolder” is created under the already created folder coming from the example sdk as shown below , it is OK . and I can see that under newfolder , the subdir.mk makefile is created where the above project strcture has no subdir.mk
Frdmke06z_i2C_polling_b2b_trasnsfer_master
>Project setting
>Includes
>CMSIS
>board
>component
>device
>source
>newfolder
>startup
>utilities
>debug
>doc
Note : the newfolder will contain some .c and .h files . I think it has to do with some makefile for the newfolder but I am not sure . Please advice
Hi Thing Piao Chew,
my wild guess is that you have 'excluded' that new folder from the build, see Exclude Source Files from Build in Eclipse | MCU on Eclipse .
So make sure your folder shows that small blue 'C' on it:
I hope this helps,
Erich
PS. if you want to learn more about icon decorators in Eclipse, have a read at Icon and Label Decorators in Eclipse | MCU on Eclipse
Oh yes , it works now . I forgot about this little tick box . thanks !!