This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: apparent ncurses lib linking problem
- From: Charles Wilson <cygwin at cwilson dot fastmail dot fm>
- To: cygwin at cygwin dot com
- Date: Thu, 03 Sep 2009 20:14:11 -0400
- Subject: Re: apparent ncurses lib linking problem
- References: <20090903123526.2872@binki>
d.henman wrote:
> g++ -g -O2 -L../mpegsound -L../nmixer -o nmixer.exe main.o -lncurses -lnmixer -lpthread -lm -lao -lpthread
> ../nmixer/libnmixer.a(nmixer.o): In function `_ZN6NMixer14DrawFixedStuffEv':
> /usr/src/mp3blaster/mp3blaster-3.2.5/nmixer/nmixer.cc:528: undefined reference to `_mvwprintw'
mp3blaster is making an assumption that is valid only on linux: that
library order doesn't matter. On windows, it does. Notice:
../nmixer/libnmixer.a(nmixer.o): ... undefined reference to ...
means that the *library*, libnmixer, has the reference to a missing
symbol. That symbol is actually in libncurses, which means that
-lncurses must come *after* libnmixer on the link command. Thus...
g++ -g -O2 -L../mpegsound -L../nmixer -o nmixer.exe main.o -lnmixer
-lncurses -lpthread -lm -lao -lpthread
should work (swap -lnmixer and -ncurses)
--
Chuck
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple