Math Operator Problems in Release mode vs Debug mode

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
ToVa_285016
Level 5
Level 5
100 replies posted 50 replies posted 50 questions asked

Hi,

   

My project compiles just fine in debug mode, but if I switch to release, it tells me for example:

   

Build error: undefined reference to `cos'

   

It does the same for my other math operators.

   

Any ideas?

   

Thank you,
Tom

0 Likes
4 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Include the math library "m" in release configuration as in debug configuration

   

 

   

Bob

0 Likes
ToVa_285016
Level 5
Level 5
100 replies posted 50 replies posted 50 questions asked

Yup, that would be it.

   

One more question, switching from Debug to Release did not significantly alter program size.  Is this normal?

   

I am pushing the FLASH limit (97.5%), and am trying to pare things down a bit.

   

Thank you,
Tom

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Tom, you ought to verify setting for compiler->optimization is set to "size".

   

97% looks really tough, is there a chance that we can have a look at your project to see if there is something that can reduce code usage.

   

 

   

Bob

0 Likes
ToVa_285016
Level 5
Level 5
100 replies posted 50 replies posted 50 questions asked

Hi,

   

Unfortunately both debug and release are at 'size' already.  

   

I do not feel comfortable posting the project, and I will probably open a case in regards to this.

   

Thank you for your assistance.

   

Tom

0 Likes