How do I solve undefined reference error using Embedded Coder/what am i doing wrong when setting up my settings?
Show older comments
Hello,
I am trying to program my dsPIC33EV starter kit using Simulink. I have my .c file that has my functions, .h file that includes my structs and extern function calls and I have a .h file from Microchip for my processor.
I am currently adding my #include "my_func.h" in header file in custom C code and src/my_func.c into source files under additional build info. my .c includes my dsPIC.h file at the top of it's code.
I have noticed that the dsPIC.h file has extern at the start of definitions which I think are being pulled by a .gld file.
i am getting this error when trying to buid:
The call to MCHP_dsPIC_stf_make_rtw_hook, during the entry hook generated the following error:
Error(s) encountered while building custom code simulation target for model 'dsPIC33EV_Test_Can'. Fix the errors in your custom code or disable 'Import custom code' if your custom code has incompatibilities.
The build process will terminate as a result.
Caused by:
Error(s) encountered while building custom code simulation target for model 'dsPIC33EV_Test_Can'. Fix the errors in your custom code or disable 'Import custom code' if your custom code has incompatibilities.
my_func.obj:my_func.c:(.rdata$.refptr.C1CFG1[.refptr.C1CFG1]+0x0): undefined reference to `C1CFG1'
collect2.exe: error: ld returned 1 exit status
Could it be how where I am putting my includes and configurations in wrong?
Also if it is the .gld file, how do I pull this in?
Thank you for the help, I appreciate it!
Answers (0)
Categories
Find more on Deployment, Integration, and Supported Hardware in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!