Undefined reference to '----' in MCU xpresso

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

Undefined reference to '----' in MCU xpresso

Jump to solution
6,494 Views
trialaccount12
Contributor V

Hi,

    I am working on LPC54018 board. I have two different software stacks in MCU xpresso

1. One using a71ch with IBM watson platform

2.Second using LPC iot module with Alexa

Both projects are working successfully when I test them independently. I wanted to integrate them. I was able to do it almost but there is a place when I am not able to proceed further.

I have two files aws_shadow.h and its corresponding aws_shadow.c files. I need to call them in my main.c file in the function void prvShadowMainTask(void *pvParameters).

I made the code changes inside ibm_watsin_demo.c which holds the main() and when I try to navigate to SHADOW_Delete() function and other shadow functions, I am able to. But when I build my project , they are throwing me an error like below:

pastedImage_1.png

I have added the amazon-freertos folder which holds all the required files. But I am not able to map it in a right way. 

Is there any declaration or initialization function/file I am missing over here?

Any pointers would be helpful.

I have attached the project files with this.

Thank you

Thanks and Regards

Niranjan

Tags (1)
1 Solution
5,956 Views
BlackNight
NXP Employee
NXP Employee

1): the problem is that the project is not setup to be moved around (or copied into a different place), because the paths are relative to your project location. You would have to change the include paths or copy the extra files.

2) I suggest you check the console view and check the object files passed to the linker. Is the file with your Shadow functions passed to the linker?

I hope this helps,

Erich

View solution in original post

8 Replies
5,955 Views
trialaccount12
Contributor V

Hi BlackNight

            Any inputs on the above questions? 

Thank you

Regards

Niranjan

0 Kudos
5,956 Views
BlackNight
NXP Employee
NXP Employee

Your uploaded zip file does not contain your full project. But what I guess is that you have 'excluded from build' the file/folder with the SHADOW functions. Can you check this (see Exclude Source Files from Build in Eclipse | MCU on Eclipse  for the exclude from build functionality).

I hope this helps,

Erich

5,956 Views
trialaccount12
Contributor V

Hi,

    Thank you for your reply. 

Yes, I tried what you mentioned above. Strangely it did not work.! I also noticed one thing, the zip file which I have attached above works only in one workspace of MCU. If I import it again into a different workspace, this below error:

pastedImage_1.png

Now I do have two questions here.

1. Why does this above behavior occur? I guess this is the reason why you were not able to run the project. Because all the files are there and it is working fine but only in one workspace. Is it because of "CWD path" below??:

pastedImage_2.png

2. Coming back to my original post, I do want to use shadow functions in my code. Any other approaches?(since exclude from build was not the issue I realized after checking)

Thank you

Thanks and Regards

NIranjan

0 Kudos
5,957 Views
BlackNight
NXP Employee
NXP Employee

1): the problem is that the project is not setup to be moved around (or copied into a different place), because the paths are relative to your project location. You would have to change the include paths or copy the extra files.

2) I suggest you check the console view and check the object files passed to the linker. Is the file with your Shadow functions passed to the linker?

I hope this helps,

Erich

5,955 Views
mahendranmanoha
Contributor III

Hi Erich,

I am also trying to merge two projects in MCUXpresso V11.0. I too have a "undefined reference to f_open()" problem even after updating the preprocessors and include paths. I am nearly sure that the problem is with mapping linker files. I would like to understand from you on how to do it in a proper way. Is there is a guide or link that I can browse to do that in the right way?

best regards,

Mahendran

0 Kudos
5,955 Views
mahendranmanoha
Contributor III

Thanks Erich and everyone who saw my post,

I was able to update all details in my Properties->C/C++ General->Paths and Symbols.

Thanks,

Mahendran

0 Kudos
5,955 Views
trialaccount12
Contributor V

Hi,

    I was able to get it working. It was the issue with linker files like you mentioned. Once I map them properly I was able to run it. 

And the project I attached was not working because it also had the linker files. 

Thank you for your help

Regards

Niranjan

0 Kudos
5,955 Views
trialaccount12
Contributor V

 Hi,

    1. Yes, I will change the location

    2. I checked it. It is getting passed to the linker function. But when I compare the properties of the amazon-freertos folder, this contains the shadow h and c files with the original project and my project, there is a difference in "includes" section. I did not see any copy/paste function to add files into includes.

In my integrated project:

pastedImage_1.png

The original project:

pastedImage_2.png

Is it possible to port the input functions?

Any documents / pointers would be helpful.

Thank you

Regards

Niranjan

0 Kudos