This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: 1.5.25-11 gcc compile issue


Robby Gieringer wrote:

> gcc -o code48_win -I/usr/include/ncurses -lncurses
> -D_WIN_ code_v49w.c
> (It gives a few warnings which are fine...then)
> : undefined reference to `_initscr'
> : undefined reference to `_newwin'
> : undefined reference to `_LINES'
> : undefined reference to `_COLS'
> : undefined reference to `_keypad'
> : undefined reference to `_nonl'
> : undefined reference to `_noecho'
> : undefined reference to `_wgetch'
> : undefined reference to `_wmove'
> : undefined reference to `_wrefresh'
> (And continues unto about another 1100 undefined
> references which a lot of them repeat)
> 
> This has compiled on nearly every other box imaginable
> with no problems.  I feel it now reads in all the
> header files, but then blows up once it goes to the
> runtime.  If there is a solution to this, I would be
> very grateful.  Again, sorry for being a newb and
> thanks for your help!

The order that you specify things on the compile command matters, and
you've got yours in the wrong order.  Put -lncurses at the end after the
objects that use symbols from it, and it should work fine.  This matters
on the other systems too, but they are more forgiving of this error. 
That doesn't mean it's still not an error.

Brian

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]