Suddenly, theres an error in a module? Topic is solved

Technical questions regarding the XTC tools and programming with XMOS.
DemoniacMilk
XCore Addict
Posts: 191
Joined: Tue Jul 05, 2016 2:19 pm

Suddenly, theres an error in a module?

Post by DemoniacMilk »

Been compiling a project quite often, didnt run into any trouble (except if I screwed up my code of course).
Since some time it is not compiling successfully, telling me there is an 'Error: Undefined reference to 'XUD_SetReady_...' (...)' in xud_cdc.xe (that is a file from a sample project). The file was not changed by me.

I searched for function calls in the file mentioned, and on hovering my mouse over the function name I can see it is defined in xud.h and shouldn't be an undefined reference. 'go to declaration' takes me to said header file.

Tried cleaning and rebuilding the project, restarted xTimeComposer (14.1.2), restarted the PC, but its still not working.
Is this a known issue and are there any ways to repair whatever might be broken?
You do not have the required permissions to view the files attached to this post.


View Solution
DemoniacMilk
XCore Addict
Posts: 191
Joined: Tue Jul 05, 2016 2:19 pm

Post by DemoniacMilk »

Hm, it works again.
DemoniacMilk
XCore Addict
Posts: 191
Joined: Tue Jul 05, 2016 2:19 pm

Post by DemoniacMilk »

I found out that the project will fail to compile after changing the optimization level.

Using the XUD_CDC example for the explorer board, compilation fails on setting -O0 instead of -O3.
undefinedReference2.PNG
Can anyone confirm this behaviour?
You do not have the required permissions to view the files attached to this post.
Gothmag
XCore Addict
Posts: 129
Joined: Wed May 11, 2016 3:50 pm

Post by Gothmag »

Yes, that's right. The compiler seems to have some issues changing -O level, on higher levels it seems to correctly set inline, lower levels you're required to do a forward declaration of the inline function ahead of usage. My suggestion is leave it on -O3 if you have the memory for it. And if you add the definition and go from low to high -O you will need to comment them back out or youll get a host of multiple definition errors.
User avatar
larry
Respected Member
Posts: 275
Joined: Fri Mar 12, 2010 6:03 pm

Post by larry »

Also you could try if doing a clean build helps. If it does, I would suggest submitting a bug report, as it could be a build issue where some changes are not picked up by compiler or makefiles.
Gothmag
XCore Addict
Posts: 129
Joined: Wed May 11, 2016 3:50 pm

Post by Gothmag »

I'm not sure about the original poster but I don't recall any difference between a clean build and not when changing -O levels. I'll check when I have time later.
DemoniacMilk
XCore Addict
Posts: 191
Joined: Tue Jul 05, 2016 2:19 pm

Post by DemoniacMilk »

Adding prototypes for the inline functions did solve the issue.
Doing a clean build didn't make any difference, I tried that as well. On changing the make file, everything is rebuild anyways?