Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > PSoC® 5 > sqrt problems with PSoC Creator and CY8C55 Family -- undefined reference to `sqrt' error

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



sqrt problems with PSoC Creator and CY8C55 Family -- undefined reference to `sqrt' error
Moderator:
ANCY

Post Reply
Follow this topic



sqrt problems with PSoC Creator and CY8C55 Family -- undefined reference to `sqrt' error

ch701builder posted on 10 Dec 2010 9:51 AM PST
Senior Member
12 Forum Posts

All, I don't know if where this question should be asked here or PSoC Creator....but...

has anybody had problems with the sqrt() function? Here is a small test code to even see if it will compile and I get a "...undefined reference to `sqrt'..." error. The example is close to the Keil help context example.

Any sugestions?

Keith

/* ========================================
 *
 *
 * ========================================
*/
#include <device.h>
#include <math.h>

float temp;
float Vmag;

void main()
{
    temp = 234.5;
    Vmag = sqrt(temp);

    for(;;)
    {
    }
}
/* [] END OF FILE */
 




Re: sqrt problems with PSoC Creator and CY8C55 Family -- undefined reference to `sqrt' error

kiku posted on 12 Dec 2010 07:00 PM PST
Cypress Employee
61 Forum Posts

Hi Keith,

 

It worked fine for me. Here is my Debugger window screenshot.

If you are still facing any issues, could you please send me your testing project?

 

Regards,

Kishore.



Re: sqrt problems with PSoC Creator and CY8C55 Family -- undefined reference to `sqrt' error

kiku posted on 12 Dec 2010 07:28 PM PST
Cypress Employee
61 Forum Posts

Hi Keith,

 

Just now I realised that you are facing this issue with PSoC5 GCC Compiler and not with PSoC3 Keil Compiler. I have created a seperate project to test this and then I found out that it is because of math library not being included in GCC compiler.

 

Please refer to the KB article written by me for more details - http://www.cypress.com/?rID=42838

 

Regards,

Kishore.



Re: sqrt problems with PSoC Creator and CY8C55 Family -- undefined reference to `sqrt' error

ch701builder posted on 13 Dec 2010 07:33 AM PST
Senior Member
12 Forum Posts

That was it, man.... what a relief. Why aren't things like this better documented?

Thanks again,

Keith



Re: sqrt problems with PSoC Creator and CY8C55 Family -- undefined reference to `sqrt' error

gwdeveloper posted on 14 Mar 2011 03:46 PM PST
Member
4 Forum Posts

 I scoured the web for this. Now the log() function works just fine. Thanks for the pointer.

 

gwdevprojects.blogspot.com






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: KXP; Secondary Owner: VWA; Sunset Date: 01/01/20