Altera_Forum
Honored Contributor
14 years agoalt_timestamp() issue!
Hi,
I am working with Altera Stratix FPGA and NiosII processor. In Hello_World program I wanted to check time duration using HAl API alt_timestamp() and alt_timestamp_start(). i wrote progarm like this: # include <stdio.h># include "sys/alt_timestamp.h"# include "alt_types.h" int main (void) { alt_u32 time1; alt_u32 time2; alt_timestamp_start(); time1 = alt_timestamp(); printf("hello from niosII!\n"); time2 = alt_timestamp(); printf("value =%u \n", (unsigned int) (time2-time1)); return 0; } after build it is showing following error: Info: Linking Hello_World_0.elf nios2-elf-g++ -T'../Hello_World_0_bsp/linker.x' -msys-crt0='../Hello_World_0_bsp/obj/HAL/src/crt0.o' -msys-lib=hal_bsp -L../Hello_World_0_bsp -Wl,-Map=Hello_World_0.map -O0 -g -Wall -EL -mno-hw-div -mhw-mul -mno-hw-mulx -o Hello_World_0.elf obj/hello_world.o -lm obj/hello_world.o: In function `main': D:\Bharani_15RPM\Bharanisp_ep1s80_15rpm_15June2011_v6_50Mhz\software\Hello_World_0/hello_world.c:33: undefined reference to `alt_timestamp_start' D:\Bharani_15RPM\Bharanisp_ep1s80_15rpm_15June2011_v6_50Mhz\software\Hello_World_0/hello_world.c:35: undefined reference to `alt_timestamp' D:\Bharani_15RPM\Bharanisp_ep1s80_15rpm_15June2011_v6_50Mhz\software\Hello_World_0/hello_world.c:39: undefined reference to `alt_timestamp' collect2: ld returned 1 exit status make: *** [Hello_World_0.elf] Error 1 can anyone tell me what may be expected mistake? Thanks in advance! sblrde