undefined reference to `alarm' error

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

undefined reference to `alarm' error

1,627 次查看
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

标记 (1)
0 项奖励
回复
5 回复数

1,600 次查看
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 项奖励
回复

1,588 次查看
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 项奖励
回复

1,586 次查看
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 项奖励
回复

1,572 次查看
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 项奖励
回复

1,610 次查看
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 项奖励
回复