Forum Discussion

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

can not use curses LIBS by -lcurses

vt100.c:

#include <curses.h>

int main()

{

initscr();

//box(stdscr,ACS_VLINE,ACS_HLINE);

move(LINES/2,COLS/2);

waddstr(stdscr,"Hello,world!");

refresh();

getch();

endwin();

return 0;

}

I build an example that use the curses for VT100.

I can build it in LINUX :

gcc -o vt100 vt100.c -lcurses

but when I used the nios2-gcc :

nios2-linux-uclibc-gcc -o vt100 vt100.c -lcurses

some errors:

vt100.c:1:20: curses.h: No such file or directory

well How can I link the correct LIBS?

5 Replies

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

    which IDE/EDS are you using?

    --- Quote Start ---

    some errors:

    vt100.c:1:20: curses.h: No such file or directory

    --- Quote End ---

    I think this is not (yet) an error related to wrong library inclusion. If the library isn't included properly you will get a linker error. This error is not a linker error.

    Have you added the directory of "curses.h" to the include pathes?

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

    Sorry I don't use linux version. I can't determine your IDE/EDS Version from your last post.

    Which NIOS EDS/IDE Version do you use?

    And have you included the directory which contains "curses.h" to the application include pathes? Is the error still coming up?

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

    arens,

    Where is curses.h located? You can't assume that the Nios II GCC has the same default include paths as your native compiler. It looks like you'll have to add an additional "-I" to include the directory where curses.h resides.

    Cheers,

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

    thanks slacker .

    I had tried :

    [root@localhost vt100]# nios2-linux-uclibc-gcc -I/usr/include/ -o hello hello.c -lcurses

    /opt/nios2/usr/bin/nios2-linux-uclibc-ld.real: cannot find -lcurses

    collect2: ld returned 1 exit status