Hi Everyone,I have a probelm with using Nios II Build for Eclipse... I wrote a small C program trying to read from a file, and I get an error "C:\altera\mysopc_nios_sram\software\mySRAM_image/hello_world_small.c:117: undefined reference to `fopen' my program is very simple, and I am including all the correct includes # include "sys/alt_stdio.h"# include <stdio.h># include <string.h># include <stdlib.h># include "system.h"# include "altera_avalon_pio_regs.h" ............... if( ( InputFile1 = fopen(name_in1, "r") ) == NULL) printf("Input File 1 can not be opened \n"); please help, Thank you :)
I'm not sure what version of Nios you are using but in the past I have opened the system library properties and unchecked "use small C library". This will probably increase your program size so you may need to increase the amount of memory allocated for your program code.
I am using Nios II 12.0 Software Build Tools for Eclipse, but I don't know where to uncheck "use small C library" ? I looked all over the place, but couldn't find it. Any ideas?Thanks
I solved the problem... Here is what I did:1) I right clicked on my project and choose Nios II --> BSP Editor 2) on the left hand side options where it says "settings" I chose Settings --> Common --> hal --> enable_small_c_library 3) I unchecked "hal.enable_small_c_library" I rebuild the project and it compiled fine :) Thank you all for your help....