[opensuse] building app; cpp undefined reference to constructor - need help fixing?
Guys, I'm trying to apply a patch to the GNU external ballistics source and package it in a rpm, but I've got an undefined reference error during the link I need help fixing. The source for the app (patched for opensuse 11.4 [113k]) is: When building, I get an error during linking: g++ -O3 -O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -L./lib/ballistics -o gebc InputWindow.o PlotWindow.o RangeWindow.o LicenseWindow.o AboutWindow.o PBRWindow.o GBCSolution.o GNU_Ballistics.o -lhpdf -lballistics -L/usr/lib64 -lfltk_images -lpng -lz -ljpeg -lfltk -lXext -lXft -lfontconfig -lXinerama -lpthread -ldl -lm -lX11 InputWindow.o: In function `InputWindow::cb_Target(Fl_Widget*, void*)': /usr/src/packages/BUILD/gebc-1.07/InputWindow.cpp:812: undefined reference to `TargetWindow::TargetWindow(int, int, GBCSolution*, GBCSolution*, GBCSolution*, GBCSolution*)' collect2: ld returned 1 exit status The error is generated on the 'new' call to create an instance of TargetWindow (line 812) in InputWindow.cpp below: void InputWindow::cb_Target(Fl_Widget* o, void* v){ InputWindow* T = (InputWindow*)v; GBCSolution* sln = T->gsln; GBCSolution* lmem1 = T->mem1; GBCSolution* lmem2 = T->mem2; GBCSolution* lmem3 = T->mem3;
new TargetWindow(600,600,sln,lmem1,lmem2,lmem3);
}
InputWindow.h properly includes TargetWindow.h, so I don't understand why I
get the undefined reference to TargetWindow::TargetWindow. The InputWindow.h
includes:
#ifndef __INPUTWINDOW
#define __INPUTWINDOW
#include "lib/ballistics/ballistics.h"
#include
El 16/05/12 23:20, David C. Rankin escribió:
Guys,
I'm trying to apply a patch to the GNU external ballistics source and package it in a rpm, but I've got an undefined reference error during the link I need help fixing. The source for the app (patched for opensuse 11.4 [113k]) is:
When building, I get an error during linking:
g++ -O3 -O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -L./lib/ballistics -o gebc InputWindow.o PlotWindow.o RangeWindow.o LicenseWindow.o AboutWindow.o PBRWindow.o GBCSolution.o GNU_Ballistics.o -lhpdf -lballistics -L/usr/lib64 -lfltk_images -lpng -lz -ljpeg -lfltk -lXext -lXft -lfontconfig -lXinerama -lpthread -ldl -lm -lX11 InputWindow.o: In function `InputWindow::cb_Target(Fl_Widget*, void*)': /usr/src/packages/BUILD/gebc-1.07/InputWindow.cpp:812: undefined reference to `TargetWindow::TargetWindow(int, int, GBCSolution*, GBCSolution*, GBCSolution*, GBCSolution*)' collect2: ld returned 1 exit status (snip) And, finally TargetWindow.cpp contains the constructor:
There is no "TargetWindow.o" object in the linker command line, and hence it will obviously fail undefined references... -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 16/05/12 23:42, Cristian Rodríguez wrote: undefined
reference to `TargetWindow::TargetWindow(int, int, GBCSolution*, GBCSolution*, GBCSolution*, GBCSolution*)' collect2: ld returned 1 exit status (snip) And, finally TargetWindow.cpp contains the constructor:
There is no "TargetWindow.o" object in the linker command line, and hence it will obviously fail undefined references...
btw, what is the target distro of the build in question ? the compiler will clearly tell you that an object "foo.o" is missing in the command line with newer distros when using the adecuate build environment.. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 05/16/2012 10:56 PM, Cristian Rodríguez wrote:
On 16/05/12 23:42, Cristian Rodríguez wrote: undefined
reference to `TargetWindow::TargetWindow(int, int, GBCSolution*, GBCSolution*, GBCSolution*, GBCSolution*)' collect2: ld returned 1 exit status (snip) And, finally TargetWindow.cpp contains the constructor:
There is no "TargetWindow.o" object in the linker command line, and hence it will obviously fail undefined references...
btw, what is the target distro of the build in question ? the compiler will clearly tell you that an object "foo.o" is missing in the command line with newer distros when using the adecuate build environment..
Thanks Christian, I got it! After patching, running autoreconf before configure fixed it :) -- David C. Rankin, J.D.,P.E. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 05/17/2012 08:37 AM, David C. Rankin wrote:
btw, what is the target distro of the build in question ? the compiler will
clearly tell you that an object "foo.o" is missing in the command line with newer distros when using the adecuate build environment..
Thanks Christian, I got it! After patching, running autoreconf before configure fixed it :)
If anyone is interested in shooting or ballistics, this little app works quite well. If put together a src.rpm for it for 11.4 if you are interested at: [161k] http://www.3111skyline.com/dl/suse/sources/gebc-1.07-1.0.src.rpm You will need fltk-devel installed to build. -- David C. Rankin, J.D.,P.E. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (2)
-
Cristian Rodríguez
-
David C. Rankin