Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
20 years ago

sofware building error

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

3 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi ieup,

    do you include the file which defines fopen?!

    Cheers,

    Danny
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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