undefined reference to `alarm' error

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

undefined reference to `alarm' error

1,629 Views
sushmasan
Contributor II

Hello Team,

I am trying to implement a software timer, as part of this, I have used 

signal(SIGALRM, event_start_init_callback);

alarm(10); // To invoke the call back handler after 10sec.

But I am getting undefined reference to `alarm' error.

I have included unistd.h. But still linked is unable to find the alarm call.

I verified that, alarm is defined in sys/unistd.h

Can someone please let me know, what I am missing here?

 

Regards,
San

Tags (1)
0 Kudos
Reply
5 Replies

1,602 Views
sushmasan
Contributor II

Hi,

Yes, I know this is LPC Micro-Controller support forum. I am using LPC1768 and Free RTOS is OS.

I am using MCUXpresso IDE v11.8.0_1165

I even noticed, signal.h, and unistd.h are available in below mentioned path.

C:\nxp\MCUXpressoIDE_11.8.0_1165\ide\plugins\com.nxp.mcuxpresso.tools.win32_11.8.0.202306131047\tools\arm-none-eabi\include

Based on that I assumed signals are supported. 

Please let me know.

 

Regards,
San

0 Kudos
Reply

1,590 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

Okay, I see.

I suppose that both the signal() and alarm() are not implemented.

You can use timer hardware module for example MRT, systick,sctimer...to implement a fixed period interrupt.

Hope it can help you

BR

XiangJun Rong

0 Kudos
Reply

1,588 Views
sushmasan
Contributor II

Hello,

I would like to use software based time delay, not a hardware based.

As my code is working on event based mechanism, so I want to avoid dependency or any other issues with hardware based interrupts.

Regards,

San

0 Kudos
Reply

1,574 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

Pls try to add the library(*.a) and check if you can find out the binary implementation of the two functions.

BR

XiangJun Rong

xiangjun_rong_0-1703055420240.png

 

0 Kudos
Reply

1,612 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

This is LPC Micro-controller support forum, as far as I know that the signal() and alarm() functions are Linux function.

Can you tell us the part number you are using? do you use Linux OS for your target board?

BR

XiangJun Rong

0 Kudos
Reply