Include unistd.h file

cancel
Showing results for 
Search instead for 
Did you mean: 

Include unistd.h file

860 Views
vrushalitaklika
Contributor III

Hi,

I want to include unistd.h file in my project. This is arch specific file, present at location

C:\NXP\S32DS_Power_v1.2\Cross_Tools\powerpc-eabivle-4_9\powerpc-eabivle\include\sys

I tried checking in sdks and project properties, but nno luck.

Can some one s32 expert help me in including this file and successfully compiling the project.

here is the screenshot of include files in my project

pastedImage_1.png

build error

Building target: SPWM_Shift_Z7_0.elf
Executing target #12 SPWM_Shift_Z7_0.elf
Invoking: Standard S32DS C Linker
powerpc-eabivle-gcc -o "SPWM_Shift_Z7_0.elf" "@SPWM_Shift_Z7_0.args"
./src/main_Z7_0.o: In function `main':
C:\Users\ox172\Documents\Workspace\SPWM_Shift_Z7_0\Debug/../src/main_Z7_0.c:168: undefined reference to `usleep'
collect2.exe: error: ld returned 1 exit status
make: *** [SPWM_Shift_Z7_0.elf] Error 1

16:54:25 Build Finished (took 4s.706ms)

0 Kudos
1 Reply

353 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

the unistd.h header contains only function declaration without implementation (the implementation is target MCU specific). If you need usleep function - you need to write your own implementation for your MCU.

Jiri 

0 Kudos