Re: [gtk-list] gtk-- problem: undefined reference to something that should exist



"Myers W. Carpenter" <myers@fil.org> writes:
> g++ vend.cpp -o vend `gtk-config --libs` `gtk-config --cflags` -lgtkmm -g
> /tmp/cca060691.o: In function `Signal_proxy0<void,Gtk_Widget>::operator()(void)':
> /usr/local/include/gtk--sigproxy.h:90: undefined reference to 
> `VendMain::VendMain(int)'
> collect2: ld returned 1 exit status
> make: *** [vend] Error 1
> 
> 	VendMain is called with no arguments and there isn't a constuctor
> with the sig of VendMain::VendMain(int).  What could be wrong?
> 	More info if you need it.
> 	thanks,

G++ has a habbit of adding one integer argument to error messages, specially
with constructors. Thus you have constructor VendMain::VendMain(), which
is called by the signal system.

Now your linker gives error because you have it declared in header file,
but there's no implementation linked in to the resulting executable -
means you're missing implementation of default constructor of VendMain.

(this all is normal C++ compiler behavior, nothing gtk-- specific.)

-- 
-- Tero Pulkkinen -- terop@modeemi.cs.tut.fi --



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]