Altera_Forum
Honored Contributor
14 years agoNIOS II stdio.h: Unresolved Inclusion error
Hi guys,
I'm using the NIOS II C editor that comes with Quartus 11sp1 web edition. When creating any code which uses stdio.h (or any other standard C library) it gives me an "Unresolved inclusion: <stdio.h>" error. Yet, this doesn't happen for any of the Altera specific libraries. Also, it complains that "NULL" is undeclared. My code is below. Do you have any ideas what might be causing this and/or how to fix it? thanks, -Max
# include <stddef.h> //gives an error
# include <stdio.h> //gives an error
# include <sys/alt_alarm.h> //no error
# include <alt_types.h> //no error
//Global definitions
# define MAX 3000
# define ALARMTICKS 1500
//Function declarations
void prototype_os(); //The OS main entry point
alt_u32 myinterrupt_handler (void* context); //Interrupt handler for the system alarm
//Global object declarations
static alt_alarm os_alarm;
int main()
{
printf("this is a test\n");
prototype_os();
return 0;
}
void prototype_os()
{
while (1)
{
//Initialize timer
if (alarm_start(&os_alarm, ALARMTICKS, myinterrupt_handler, NULL) < 0)
{
printf("No system clock was available\n");
}
alt_printf("This is the prototype OS for my exciting CSE351 projects!\n");
int j = 0;
for (j= 0; j < MAX; j++)
{
//do nothing... for now!
}
}
}
alt_u32 myinterrupt_handler (void* context)
{
alt_printf("Interrupted by the timer!\n");
return ALARMTICKS;
}