Using trigoniometry in FX3

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

cross mob
MaFa_974161
Level 5
Level 5
100 sign-ins 50 replies posted 50 questions asked

Hello,

   

I'm using FX3 example "USBBulkSourceSinkLED"

   

and I want to fill my buffer with sine wave.

   

If I add #include "math.h" and use x = sin(y)

   

compiler tell me "undefined reference to 'sin'"

   

 

   

Someone can help me ?

0 Likes
1 Reply
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hi,

   

Please do the following modifications to "USBBulkSourceSinkLED" example project:

   

1. Right click on the "USBBulkSourceSinkLED" project and go to Properties.

   

2. Go to C/C++ Build -> Settings.

   

3. In the Tool Settings tab, go to ARM Sourcery Windows GCC C Linker -> Libraries.

   

4. In the Libraries(-l) window, click on Add... menu and enter 'm' without quotes in the pop-up window and click OK.

   

5. Click on Apply and Ok.

   

6. Rebuild the project. Now, there won't be any linker errors.

   

I have attached a snapshot of Properties window for your reference.