2009-03-31 01:55:59     Compiling ncurses

Document created by Aaronwu Employee on Aug 14, 2013
Version 1Show Document
  • View in full screen mode

2009-03-31 01:55:59     Compiling ncurses

Jasper Horsting (BELGIUM)

Message: 71811   

 

Hey

 

I have to make a finel work for school.

 

1 of my tasks is making ncurses on a BF537 whit ucLinux. And watch it bij the serial interface.

 

I can compile it just for my pc but not for the Blackfin.

 

it is just a simple hello world:

 

#include <ncurses.h>

 

int main()

{  

    initscr();                             /* Start curses mode           */

    printw("Hello World !!!");    /* Print Hello World          */

    refresh();                           /* Print it on to the real screen */

    getch();                             /* Wait for user input */

    endwin();                           /* End curses mode          */

 

    return 0;

}

 

 

 

 

I compile like this:

 

bfin-uclinux-gcc hello.c -lncurses

 

i got 1 error

 

hello.c:1:21: error: ncurses.h: No such file or directory

 

 

 

What do i have to now?

 

 

 

greetz

 

hosti

 

 

 

 

 

TranslateQuoteReplyEditDelete

 

 

2009-03-31 02:07:07     Re: Compiling ncurses

Mike Frysinger (UNITED STATES)

Message: 71812   

 

the toolchain is only the toolchain.  it doesnt come with any libraries.  you can either build up ncurses and such by yourself, or use the uclinux-dist to build it up.

 

read this page for more information:

http://docs.blackfin.uclinux.org/doku.php?id=uclinux-dist:existing_libraries

QuoteReplyEditDelete

 

 

2009-03-31 03:02:43     Re: Compiling ncurses

Jasper Horsting (BELGIUM)

Message: 71825   

 

Hey

 

 

 

When i follow the site and i do this:

 

bfin-linux-uclibc-gcc -O2 hello.c -o hello -isystem /home/jasper/Desktop/uClinux-dist-2008R1.5-RC3/staging/usr/include -L/home/jasper/Desktop/uClinux-dist-2008R1.5-RC3/staging/usr/lib

 

 

 

I got this:

 

/tmp/ccRMBuqi.o: In function `_main':

hello.c:(.text+0xa): undefined reference to `_initscr'

hello.c:(.text+0x16): undefined reference to `_printw'

hello.c:(.text+0x1e): undefined reference to `_stdscr'

hello.c:(.text+0x24): undefined reference to `_wrefresh'

hello.c:(.text+0x2c): undefined reference to `_wgetch'

hello.c:(.text+0x32): undefined reference to `_endwin'

collect2: ld returned 1 exit status

 

 

I dont now what to do with this.

 

greetz

 

hosti

TranslateQuoteReplyEditDelete

 

 

2009-03-31 03:08:43     Re: Compiling ncurses

Mike Frysinger (UNITED STATES)

Message: 71827   

 

you added search paths but then dropped the actual linkage to ncurses ...

QuoteReplyEditDelete

 

 

2009-03-31 03:45:13     Re: Compiling ncurses

Jasper Horsting (BELGIUM)

Message: 71833   

 

I dont you understand completely.

 

Could you give an example of wath i have to do.

TranslateQuoteReplyEditDelete

 

 

2009-03-31 04:16:46     Re: Compiling ncurses

Mike Frysinger (UNITED STATES)

Message: 71846   

 

your first example used -lnucrses ... good

 

your second example did not ... bad

QuoteReplyEditDelete

 

 

2009-04-02 10:21:31     Re: Compiling ncurses

Jasper Horsting (BELGIUM)

Message: 72056   

 

Hi

 

i just added -lncurses. Like this

 

bfin-linux-uclibc-gcc hello.c -o hello -lncurses -isystem /home/jasper/blackfin/uClinux-dist/staging/usr/include -L/home/jasper/blackfin/uClinux-dist/staging/usr/lib

 

 

 

i added also a text file with my errors.

 

he doenst say anymore that ncurses.h doenst exist but this is the most of all ¨failed to merge target specific data of file¨

 

at the and there are a lot of warnings.

 

note: my pad is a bit different

 

 

 

thanks

 

fail.txt

TranslateQuoteReplyEditDelete

 

 

2009-04-02 11:06:54     Re: Compiling ncurses

Mike Frysinger (UNITED STATES)

Message: 72062   

 

like the error says, you cant mix FLAT and FDPIC object formats.  pick one.

QuoteReplyEditDelete

 

 

2009-04-03 08:48:03     Re: Compiling ncurses

Jasper Horsting (BELGIUM)

Message: 72104   

 

Hey

 

 

 

it works fine for the hello world now.

 

but wen i doe the the same with lmenu and it compiles fine. Ans i load it to the board with uCLinux.

 

i got tis error

 

can't load library 'libmenu.so.5'

TranslateQuoteReplyEditDelete

 

 

2009-04-03 09:07:25     Re: Compiling ncurses

Mike Frysinger (UNITED STATES)

Message: 72105   

 

the lib isnt on the board, so copy it over from the staging dir

Attachments

Outcomes