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++

sofware building error

Altera_Forum
Honored Contributor II
1,325 Views

Hi!! 

 

I am working with the Nios II IDE version 5.0 and trying to introduce a  

software design into a Cyclone II DSP which FPGA is the EP2C35 that previously  

has been hardware-programmed with a SOPC builder design. 

Once I have opened a project(in my case count library) have tried to build it  

and always have given the same problem: 

 

make -s all  

Compiling count_binary.c... 

Linking count_binary_0.elf... 

obj/count_binary.o(.text+0x3d8): In function `main': 

../count_binary.c:324: undefined reference to `fopen' 

collect2: ld returned 1 exit status 

make: *** [count_binary_0.elf] Error 1 

Build completed 

 

 

Could anybody help me? I am totally desesperated!! 

Thanks a lot 

 

P.D:the fopen is for opening the device driver of a LCD
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
231 Views

Hi ieup, 

 

do you include the file which defines fopen?! 

 

Cheers, 

 

Danny
0 Kudos
Altera_Forum
Honored Contributor II
231 Views

Yes I have a header file that has all the "includes" included 

 

That is why I do not understand where the error is  

 

Thanks for your answer 

 

ieup
0 Kudos
Altera_Forum
Honored Contributor II
231 Views

Hi ieup, 

 

sounds like your linker does not refer to the std libraries. 

In your project properties, C/C++ Build -> Tool Settings -> Linker -> General add 'c' to Libraries and the path to libc to Library Paths. 

You could also try the compiler flag -fno-builtin-<function name> to tell the compiler to use fopen. 

 

hope this helps, 

--wolf
0 Kudos
Reply