The link process of the "demo" program seems to rely on symbol definitions which are left out when -fno-implicit-templates is set in CXXFLAGS. Reproducible: Always Steps to Reproduce: 1. put "-fno-implicit-templates" into CXXFLAGS at /etc/make.conf 2. USE="-nocxx" emerge ncurses Actual Results: ... i686-pc-linux-gnu-g++ -o demo ../obj_s/demo.o -L../lib -lncurses++ -L../lib - lform -lmenu -lpanel -lncurses -ldl -Wl,-rpath,/var/tmp/portage/ncurses-5.4. 20050319/work/narrowc/lib -I../c++ -I../include -I/var/tmp/portage/ncurses-5.4. 20050319/work/ncurses-5.4/c++ -DHAVE_CONFIG_H -I/var/tmp/portage/ncurses-5.4. 20050319/work/ncurses-5.4/c++/../include -I. -I../include -D_GNU_SOURCE - DNDEBUG -march=pentium3 -mtune=pentium3 -mmmx -msse -mfpmath=sse,387 -g0 -O2 - pipe -fomit-frame-pointer -fno-stack-protector -fprefetch-loop-arrays -ffast- math -fno-rtti -fno-implicit-templates -fPIC ../obj_s/demo.o(.gnu.linkonce.t._ZN6MyMenuC1Ev+0x427): In function `MyMenu:: MyMenu()': : undefined reference to `vtable for NCursesUserItem<UserData>' ../obj_s/demo.o(.gnu.linkonce.t._ZN6MyMenuC1Ev+0x451): In function `MyMenu:: MyMenu()': : undefined reference to `vtable for MyAction<UserData>' collect2: ld returned 1 exit status make[1]: *** [demo] Error 1 make[1]: Leaving directory `/var/tmp/portage/ncurses-5.4.20050319/work/narrowc/ c++' make: *** [all] Error 2 Expected Results: compile without error it seems the implicit templates carry some information, which is needed to succeed.
*** Bug 90827 has been marked as a duplicate of this bug. ***
argh! early morning... to reproduce: 1. put "-fno-implicit-templates" into CXXFLAGS at /etc/make.conf 2. emerge ncurses to avoid: 1. remove "-fno-implicit-templates" into CXXFLAGS at /etc/make.conf 2. emerge ncurses to solve: (bad) filter the compiler flag out (better) add arguments to the linker
fixed in portage but you really should just drop the flag from your CXXFLAGS since there's no real point to it
thanks for the fix! btw, this flag is beneficial when /var/tmp/portage is short on space and you want to compile _big_ packages like xorg-x11, openoffice, firefox etc.