This is the mail archive of the
mailing list for the Cygwin project.
Re: 1.5.25-11 gcc compile issue
- From: Brian Dessent <brian at dessent dot net>
- To: Robby Gieringer <thebhead at yahoo dot com>
- Cc: cygwin at cygwin dot com
- Date: Tue, 22 Apr 2008 12:18:12 -0700
- Subject: Re: 1.5.25-11 gcc compile issue
- References: <email@example.com>
- Reply-to: cygwin at cygwin dot com
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.
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html