undefined reference to `alarm' error

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

undefined reference to `alarm' error

1,629件の閲覧回数
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,602件の閲覧回数
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,590件の閲覧回数
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,588件の閲覧回数
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,574件の閲覧回数
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,612件の閲覧回数
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 件の賞賛
返信