Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

undefined reference to fseek

Altera_Forum
Honored Contributor II
2,293 Views

Hello everyone i am doing edge detection on de2-115 using quartus and nios2.  

When i tried to build my project it shows me errors like undefined reference to fseek, fread, fopen. i have included all header files like stdio.h and stdlib.h 

Can anyone tell me how to solve this errors.
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
1,182 Views

You also need to link in the library that contains those functions. See the software development documentation for details. This post also has some good information. http://www.alteraforum.com/forum/showthread.php?t=37240

0 Kudos
Altera_Forum
Honored Contributor II
1,182 Views

 

--- Quote Start ---  

You also need to link in the library that contains those functions. See the software development documentation for details. This post also has some good information. http://www.alteraforum.com/forum/showthread.php?t=37240 

--- Quote End ---  

 

 

I was implementing edge detection on nios2. when i run the c program for edge detection i was getting this errors like undefined reference to fseek, fopen, fread, fopen and others were regarding on chip memory overflow. so I did setting on bsp  

1:Settings --> Common --> hal --> enable_small_c_library 

2:"hal.enable_small_c_library" 

So it cleared all errors regarding Fseek and others undefined reference but I have still this errors.  

Do you know how to solve this one 

Thankshttp://www.alteraforum.com/forum/attachment.php?attachmentid=12069&stc=1
0 Kudos
Altera_Forum
Honored Contributor II
1,182 Views

That error is caused because as it says, your object code is too large to fit in the on-chip memory. You can either move your code to sram or sdram, or enlarge the on-chip memory (if possible), or shrink your object code by going back to the small C library and not using fopen, fread, fseek, etc.

0 Kudos
Altera_Forum
Honored Contributor II
1,182 Views

Hello again,  

 

I have enlarge the on chip memory size and disable small c library. So now I am running my program its just giving one printf statement.  

in my C program It has one input image and output will give me edge detected image. My question where I have to put my source images. I have kept it in the folder where my helloworld program is stored. Is it right ?? 

 

Thanks
0 Kudos
Reply