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
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include "GBCSolution.h"
#include "RangeWindow.h"
#include "AboutWindow.h"
#include "LicenseWindow.h"
#include "PlotWindow.h"
#include "TargetWindow.h"
class InputWindow : public Fl_Window{
public:
InputWindow(int w, int h, const char* title );
~InputWindow();
<snip>
static void cb_Target(Fl_Widget*, void*);
<snip>
TargetWindow.h contains the prototype for the TargetWindow constructor:
#ifndef __TARGETWINDOW
#define __TARGETWINDOW
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include "GBCSolution.h"
class TargetWindow : public Fl_Window {
public:
TargetWindow(int, int, GBCSolution*, GBCSolution*, GBCSolution*, GBCSolution*);
~TargetWindow(void);
<snip>
And, finally TargetWindow.cpp contains the constructor:
#include "TargetWindow.h"
#define PT_PATH 0
TargetWindow::TargetWindow(int w, int h, GBCSolution* Gsln, GBCSolution* GMEM1,
GBCSolution* GMEM2, GBCSolution* GMEM3) : Fl_Window(w,h,"Solution Visualization
Tools"){
<snip>
So what rule am I not seeing that is leading to the "InputWindow.cpp:812:
undefined reference to `TargetWindow::TargetWindow(..." error? Is there
something simple in the way it is declared that causes the problem? If I can
send anything else, please let me know. I'm curious -- what am I missing here --
it all looks good (to me). Thanks.
======== original sourceforge sources + patches below =========
http://sourceforge.net/projects/balcomp/files/GNU%20Ballistics%20-%20Source/...
The original patch is:
https://sourceforge.net/tracker/?func=detail&aid=3167921&group_id=216428&atid=1037641
The patch to build on opensuse is (just fixes fl_draw.h -> fl_draw.H):
http://www.3111skyline.com/dl/suse/sources/gebc-openSuSE.diff
--
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